Phpsession problems this post was last edited by u010001532 in 2013-06-0818: 00: 51. I want to use session to log on to a user to access a specific page. users who are not logged on cannot access it. However, you can directly access the page by entering the page address in your browser. For guidance. Index. phpsession_start (); if (Login () & nbsp; & nbs php session
This post was last edited by u010001532 at 18:00:51
I want to use session to log on to a user to access a specific page. users who are not logged on cannot access the page.
However, you can directly access the page by entering the page address in your browser. For guidance.
// Index. php
Session_start ();
If (Login () = true)
{
$ _ SESSION ['login'] = 'OK ';
// Jump to page. php
}
Else
{
Echo "Login error ";
}
// Page. php
Session_start ();
Echo $ _ SESSION ['login'];
If (empty ($ _ SESSION ['login']) | $ _ SESSION ['login']! = 'OK') // skip to the index if you have not logged in
{
?> Script setTimeout ('window. location = "index. php" ', 1000); script
}
.....
.....