Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Retrieve Values from the Current Session
How To Retrieve Values from the Current Session? - PHP Script Tips - Understanding and Using Sessions
✍: FYIcenter.com
If you know some values have been saved in the session by an other 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
2007-04-18, 5201👍, 0💬
Popular Posts:
What is difference between SITP and UTP in testing ? UTP (Unit Test Plan) are done at smallest unit ...
Can Multiple Cursors Being Opened at the Same Time? - Oracle DBA FAQ - Working with Cursors in PL/SQ...
Which bit wise operator is suitable for turning off a particular bit in a number? The bitwise AND op...
How To Control Vertical Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By d...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...