Okay, I have a little project on the way but somethings bothering me at the moment.
Ive created a page to confirm the details of your login attempt. If your login matches with the database, it goes to one page. If it doesnt, it goes to another. You can see for yourself at http://www.blinkingeye.net
Both of the messages are in a "Show if.. " statement. So my question is, can I have it so if your login attempt was successful, it sets the cookies. Ive tried moving the cookie script inside the "Show if.." statement but it doesnt work. Any help would be grateful, cheers.
Can you set cookies anywhere?
Moderator: General Moderators
do you get any errors messages? it prolly cos of the headers, read this and it will...uh..show you the light. 
viewtopic.php?t=1157
viewtopic.php?t=1157
Okay, heres a simpler answer..
At the moment, the way the logging in takes place is this:
The user goes to "user_login.php" to enter the username and password. Then it directs to "login_confirmation.php" which is really self-explanatory. If the username and password match up in the database it displays "Welcome back, username" if it doesnt then it shows "The information you displayed was incorrect, try again blah blah". At the moment its storing the cookies whether the password and usernames wrong or not.
So my question is, is there a way for the user to go to "user_login.php" then to "login_confirmation.php" to see whether its correct, and if it IS correct it goes to "user_home.php" where it stores the cookie. Does that make sense?
Im asking because Im only able to store the cookie on the page after the login page. Im not sure how to carry on the username and password, to say maybe 2 pages after you have logged in.
If that didnt make sense, flame me.
At the moment, the way the logging in takes place is this:
The user goes to "user_login.php" to enter the username and password. Then it directs to "login_confirmation.php" which is really self-explanatory. If the username and password match up in the database it displays "Welcome back, username" if it doesnt then it shows "The information you displayed was incorrect, try again blah blah". At the moment its storing the cookies whether the password and usernames wrong or not.
So my question is, is there a way for the user to go to "user_login.php" then to "login_confirmation.php" to see whether its correct, and if it IS correct it goes to "user_home.php" where it stores the cookie. Does that make sense?
Im asking because Im only able to store the cookie on the page after the login page. Im not sure how to carry on the username and password, to say maybe 2 pages after you have logged in.
If that didnt make sense, flame me.