Question: Please help me to write down the php code below. Instruction image attached and also instructions given as comments. code */ /* You print, recall

Please help me to write down the php code below. Instruction image attached and also instructions given as comments.

/* REMOVE comments to see all data passed to this PHP program, this is useful for debugging. print_r($_GET); */

/* Recall all data is passed from the form to this PHP file as an associative array */ /* that is defined in variable $_GET. This is a simple example to help you get started. */ $name = $_GET["name"];

/* Since "gift" is a checkbox, it ,ight not be set by the user. in this case the variable will not be defined . You can use PHP "isset()" function to test if it was set or not in the $_GET. */ if ( isset($_GET["gift"]) ) { $gift = $_GET["gift"]; $message = $_GET["message"]; } else { $gift = false; $giftmessage = ""; }

/* You should assign the rest of the variables here, in particular there are several other parmemeters passed from the Forms: color, size and price, credit card type, card number, date. Look at the form names carefully. */

?>

code */ /* You print, recall that the variables from the Forms need to be printed using */ /* the style class orderitem defined above. */ print "

Confirmation of your &quoteCat Fails Video&quote T-shirt order!

";

/* you also need to write to the file "orders.txt" the string containing the following info: name, size and price, color, cardnumber */

/* if you print out the gift message, use class "message" defined above - see Lab document */ ?>

Previous Orders

$line "; } ?>

Please help me to write down the php code below. Instruction image

Confirmation of your "Cat Fails Video"T-shirt order Name: John Brown Item: Sma11-$9.99 (Black) Credit card: visa Card number: 4000400044445555 Expiration date: 2018-10-10 Gift Message Print the parameters here These should use to modified their appearance to loolk blue Only output this if gift was clicked. The output is as follows: njoy your gift

Gift Message

(message from form) Previous Orders John Smith, Medium $10.99, white, i Abdel Zhang, Redium $10.99, Black, 508850a05a9e5555 (hint: you'll need to use an if statement) This part is to practice more file I/O For every order, write to the file "orders.txt" the following output: "Name, Size and Price, Color, Credit Card Number " (in this example name, size and price, etc are passed from the Forms) Use the function: file_put_contents("orders.txt", string you want to write to the file, FILE_APPEND) to achieve this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!