Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
May 30, 2005, 5:43 pm
rate this thread
I want to prevent non-registered users to view a page in my website,
For example, when a non-registered user clicks the history page, the
website site refuses to go there since he is not registered.
what is the best way to do it? And how to identify a user has already
logged in when he click the history page?
Re: Track user usage, session tracking or cookies?
I use sessions to manage users once they log in. Here is an article
about managing users with mysql and sessions:
Once a user logs in, declare a session:
Declare a session variable saying that the person is logged in:
$_SESSION['login'] = true;
When a user tries to get to a user-only page, check the session
variable to see if the person is a logged-in registered user:
if ($_SESSION['login'] == true)
Let user request the page;
Send user to the registration page;
- » Detecting PDF files in a folder and sorting them by date
- — Previous thread in » PHP Scripting Forum