From the course: PHP for Web Designers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Ending the PHP session and deleting the data - PHP Tutorial
From the course: PHP for Web Designers
Ending the PHP session and deleting the data
Storing values in session variables is useful, but you should always delete them and end the PHP session when they're no longer needed. You can delete individual session variables. And there's also a quick way, to delete them all. In the Hansel and Petal site, let's start by selecting some flowers. So pink calla lilies, we'll have three of those and we'll have oh, let's have five Peruvian lilies. And we'll have some roses, yellow rose. I'm not from Texas, but we'll have some yellow roses. And then we'll add to the basket. So they're listed there, calla lilies, Peruvian lilies, and roses. So, let's try to delete, or to unset the session variable for Peruvian Lilies. We need to go back to our editing program to work on that. So, here we are in order.php. And, at the top of order.php, beginning on line three. We've got an if block, and that runs code only if Post Bouquet has been set. In other words, if we've submitted from the form in Build a Bouquet. So we must make sure that our code…
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
-
-
-
-
-
-
-
(Locked)
Getting form input sent by the POST method4m 48s
-
Retrieving values from a URL's query string4m 8s
-
(Locked)
Challenge: Plan the order form2m 28s
-
(Locked)
Solution: Plan the order form4m 42s
-
(Locked)
Finding and extracting a substring7m 38s
-
(Locked)
Organizing the form data into arrays7m 15s
-
(Locked)
Using a loop to build a table for the data4m 42s
-
(Locked)
Controlling which rows are displayed7m 45s
-
(Locked)
Creating a custom function to extract part of a file name7m 43s
-
(Locked)
Calculating the order total6m 34s
-
(Locked)
Using PHP sessions to preserve data3m 14s
-
(Locked)
Storing data in session variables7m 33s
-
(Locked)
Ending the PHP session and deleting the data5m 37s
-
(Locked)
-
-
-