Tools, FAQ, Tutorials:
Retrieving Values Stored in Session in PHP
How To Retrieve Values from the Current Session in PHP?
✍: FYIcenter.com
If you know some values have been saved in the session by another script requested by the same visitor, you can retrieve those values back by using the pre-defined associative array called $_SESSION. The following PHP script shows you how to retrieve values from the session:
<?php session_start(); print("<html><pre>"); $myLogin = $_SESSION["MyLogin"]; print("Value of MyLogin has been retrieved: ".$myLogin."\n"); $myColor = $_SESSION["MyColor"]; print("Value of MyColor has been retrieved: ".$myColor."\n"); print("</pre></html>\n"); ?>
You need to save this script to your Web server as next_page.php. Now visit first_page.php and click the "Next Page" hyper like, you will get:
Value of MyLogin has been retrieved: FYICenter Value of MyColor has been retrieved: Blue
⇐ Saving Values in the Session in PHP
2016-10-26, 1301🔥, 0💬
Popular Posts:
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How To Pass Arrays By References? in PHP? Like normal variables, you can pass an array by reference ...
How to use the "set-body" Policy Statement for an Azure API service operation? The "set-body" Policy...
How to add images to my EPUB books Images can be added into book content using the XHTML "img" eleme...
What is EPUB 3.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 3.0 Metadata "dc:publisher" ...