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, ∼1722🔥, 0💬
Popular Posts:
How To Create an Array with a Sequence of Integers or Characters in PHP? The quickest way to create ...
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
Tools, FAQ, Tutorials: JSON Validator JSON-XML Converter XML-JSON Converter JSON FAQ/Tutorials Pytho...
How to create a navigation file like navigation.xhtml for an EPUB 3.0 book? At least one navigation ...