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, 5125👍, 0💬
Popular Posts:
What is the purpose of finalization? The purpose of finalization is to give an unreachable object th...
it will be very helpful if you send some important Questions with Answers of DBMS Tell us what types...
Which JavaScript file is referenced for validating the validators at the client side ? WebUIValidati...
How To Escape Special Characters in SQL statements? - MySQL FAQs - Introduction to SQL Basics There ...
What Tools to Use to View HTML Documents? The basic tool you need to view HTML documents is any Web ...