From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Solution: Plan the order form - PHP Tutorial
From the course: PHP for Web Designers
Solution: Plan the order form
The challenge was to devise a plan for handling the data submitted by the Build a Bouquet page so that the details of the order are displayed correctly in the order confirmation page. This is the way it will work in the final version, so if I change Calla Lillies from Blush to Purple, and add three of those, and let's have, say, three sunflowers. And some gerberra daisies, orange. My color coordination may not be perfect, but never mind. And then add to basket. And all that will be displayed here are those items that have been ordered. The quantity, the cost, the shipping, and the total. So that's the ultimate aim. The first stage in dealing with any form is to find out what sort of data it submits. So let's go to our editing program. There's bouqet.php and I've scrolled it down to the bottom. There is the submit button. The name of the submit button on line 247 is bouquet. So, we can use that knowledge, to find out what is being submitted, from the form when we go to order.php. So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Getting form input sent by the POST method4m 48s
-
Retrieving values from a URL's query string4m 8s
-
Challenge: Plan the order form2m 28s
-
Solution: Plan the order form4m 42s
-
Finding and extracting a substring7m 38s
-
Organizing the form data into arrays7m 15s
-
Using a loop to build a table for the data4m 42s
-
Controlling which rows are displayed7m 45s
-
Creating a custom function to extract part of a file name7m 43s
-
Calculating the order total6m 34s
-
Using PHP sessions to preserve data3m 14s
-
Storing data in session variables7m 33s
-
Ending the PHP session and deleting the data5m 37s
-
-
-
-