Class Notes (834,049)
Canada (508,296)
60-270 (2)

Shopping Website Notes for 60-207

8 Pages
Unlock Document

Computer Science
Numanul Subhani

HTML Form  The HTML form is used to collect the data o Item on sale o Quantity to order o Price of the item  Post method is used to pass this information to the server  The data is stored in a file inv.dat Price and Inventory Control Price and Inventory Control  The file inv.dat after the form is submitted  Mountains,5,4.00  Rivers,5,5.00 PHP example "; print "$d2 -- quantity is $q2 and price is $p2 "; //the current quantity of DVDs is displayed for verification $file = fopen("inv.dat","w") or die("error-- cannot open inv.dat"); // open the file to put the inventory in fputs($file, "$d1,$q1,$p1\n"); // put in the name, quantity, and price for first DVD fputs($file, "$d2,$q2,$p2\n"); // put in the name, quantity, and price for the second DVD fclose($file); // Close the opened file itemAdded($d1); itemAdded($d2); function itemAdded ($x) // Message to indicate that the inventory is successfully added { print ("Item $x added to the inventory "); } ?> Specification  This program o allows the consumer to enter the number of items desired o Indicates whether the order can be accepted o Updates the inventory, and o Display the amount of the purchase Shopping Shopping  Use a HTML form to collect the quantity to be purchased  The post method is used to pass the information to the server when submit button is clicked Process Order "); print (""); $q1 = $_POST["quan1"]; $q2 = $_POST["quan2"]; $dvd1 = "Mountains"; $dvd2 = "Rivers"; //variables get assigned value $file = fopen("inv.dat","r"); $i =0; $total = 0.00;
More Less

Related notes for 60-270

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.