Sorry no demo
This script show you how to setup a session and read that session variable. if no session variable is found then it is passed to a form so they can start a session.
works on php version 4.1+
Snippet uploaded by: snippet
Snippet By: snippet
//must go at the beginning of the page.
//if you want to check for the variable that is
//suppose to be in the session, one way is this.
//lets say $_POST['username'] is from the form.
//if it is set, you want to verify that it is the user
//I would run check on the Database to be sure.
//after you have checked it with the database and
// all is ok, then you need to register the variables
// you got from the database
$_SESSION['userid'] = $variableFromDB
$_SESSION['username'] = $variableFromDB
//goto form so they can login and to creat a session.
© 2005 snippetlibrary.com All Rights Reserved.