The use of the session
Session I read the manual above is the first open session ();
Then in a session variable
$_seesion[' user ']= ' user ';
But I don't know how to use it.
Two pages, one page is login.php, login page,
One is edit.php, how to achieve in two pages with the same session, that is, after the login to see the contents of the
Login.php's Code
$name = ' Vicky ';
$user = ' Vicky ';
$passwd = ' 001 ';
$pwd = ' 001 ';
Seesion_start ()
if ($name = = $user && $passwd = = $pwd) {
The value above this position is true, according to the truth, this should be the execution session, what should be done?
$_session[' $name ']= ' $name ';
}else{
Echo ' please login again ';
}
The other edit.php page How to judge the ID of this session
Whether Seeion_start () is also turned on;
Share to:
------Solution--------------------
$_session[' name ']= $name; That's what it's about.
The other edit.php page How to judge the ID of this session
Whether Seeion_start () is also turned on;
Yes, also to open Seeion_start ();
echo $_session[' name ']; View Results