Users can log into my site via a php login script or registration form (for new users). Login checks that the credentials are correct, and the registration creates a new entry in a mysql db.
At this point a new session is started, a session variable ($_SESSION['logged_in']) is set to yes, and they are redirected using header(location ).
Can anyone suggect code to place on subsequent pages that will check on arrival if the current user has a session started and that the variable 'logged_in' is set to "yes" (if so, do page, else display "you are not authorised, etc")?
At this point a new session is started, a session variable ($_SESSION['logged_in']) is set to yes, and they are redirected using header(location ).
Can anyone suggect code to place on subsequent pages that will check on arrival if the current user has a session started and that the variable 'logged_in' is set to "yes" (if so, do page, else display "you are not authorised, etc")?
Comment