MandoMan
04-01-2006, 04:06 AM
I have a registration script created and a database and all that good stuff, but now I am creating a log in script.
Basically what I want to do is for them to enter their password and username, use a query to verify it was correct, and then execute some code otherwise redirect them.
Now if they successfully log in, I want to use a method to be able to check on each page I want them to be logged in and see if they are, well, already logged in.
Now, this would involve cookies, or sessions. I don't know which one I should use. If I use a session, it says I should use the start session function. Now, if I use the start session function on each page, won't that let a person be able to just access a member - only page and just start a session, since start session is on each page? Or am I just looking at it wrong?
And with cookies, how would I verify they are logged in. Would I just check that the cookie exists, and if it does execute whatever code, and if not redirect them?
Extra info is appreciated.
Basically what I want to do is for them to enter their password and username, use a query to verify it was correct, and then execute some code otherwise redirect them.
Now if they successfully log in, I want to use a method to be able to check on each page I want them to be logged in and see if they are, well, already logged in.
Now, this would involve cookies, or sessions. I don't know which one I should use. If I use a session, it says I should use the start session function. Now, if I use the start session function on each page, won't that let a person be able to just access a member - only page and just start a session, since start session is on each page? Or am I just looking at it wrong?
And with cookies, how would I verify they are logged in. Would I just check that the cookie exists, and if it does execute whatever code, and if not redirect them?
Extra info is appreciated.