Session usage problems session I have read the manual above is to first enable session (); then in a session variable $ _ SEESION ['user'] = 'user '; but I don't know how to use two pages. one page is login. php, logon page, one is edit. php session usage problems
Session I read the manual. the above is to enable session () first ();
Then in a session variable
$ _ SEESION ['user'] = 'user ';
But I don't know how to use it.
Two pages: login. php, logon page,
One is edit. php. how can I use the same SESSION on the two pages? the content in the SESSION can be viewed only after logon.
Login. php code
$ Name = 'Vicky ';
$ User = 'Vicky ';
$ Passwd = '001 ';
$ Pwd = '001 ';
Seesion_start ()
If ($ name = $ user & $ passwd = $ pwd ){
// The value above this position is true. in principle, the session should be executed. what should I do?
$ _ SESSION ['$ name'] =' $ name ';
} Else {
Echo 'Log On Again ';
}
How can I determine the session ID on another edit. php page?
Enable seeion_start ();
Share:
------ Solution --------------------
$ _ SESSION ['name'] = $ name; // do you want to do this?
How can I determine the session ID on another edit. php page?
Enable seeion_start ();
Yes, you must also enable seeion_start ();
Echo $ _ SESSION ['name']; // view the result