Hi
I am getting very frustrated because I cannot seem to get the hand of sessions in PHP. When someone logs in with user and password, I want to set a session variable called 'user' to the value "Admin".
Then on any of the pages that only admin should access I want to test the value of the 'user' variable to see if it is "Admin" or not (I presume not registered or "")
If it is not "Admin" then I want to redirect them back to the admin login screen otherwise they can carry on.
I cannot get the variable 'user' to relinquish any value. I have looked at the examples and tried a few ( including the seemingly simple "you have been here $count times." example and they do not work. The count never goes above 1.
I am using Win2K with IIS and PHP 4.0.2 and MySQL.
I would really appreciate it if someone could give me some example code as to how I could accomplish the above.
Thanks
Tim Cowan