yanjchan Posted March 8, 2009 Share Posted March 8, 2009 Hi! I have a multi stage login script that I'm working on as a hobby project, and I need some help. The user logs on, a md5 hash is generated and then compared. That all works fine and dandy, but to set a cookie for the login variable, it needs to be above the <html> section of a webpage. How should I do this, while retaining the variables holding the hash? Thanks! Link to comment https://forums.phpfreaks.com/topic/148422-send-data-to-next-webpage-in-redirect/ Share on other sites More sharing options...
WolfRage Posted March 8, 2009 Share Posted March 8, 2009 <?php session_start(); setcookie('cookie_name','cookie_value',0,'/','www.mydomain.com',FALSE,TRUE); //change FALSE to TRUE if you are using SSL and want the cookie to only exist in a SSL enviroment. $_SESSION['my_hash']=$hash_value; //html goes below here. Link to comment https://forums.phpfreaks.com/topic/148422-send-data-to-next-webpage-in-redirect/#findComment-779294 Share on other sites More sharing options...
yanjchan Posted March 8, 2009 Author Share Posted March 8, 2009 Thanks for the response! However, all of the processing is done in the HTML tags, so how can I send the variable from the if... else statement to the top of the page? Thanks! Link to comment https://forums.phpfreaks.com/topic/148422-send-data-to-next-webpage-in-redirect/#findComment-779295 Share on other sites More sharing options...
yanjchan Posted March 8, 2009 Author Share Posted March 8, 2009 Nvm. I fixed it. I used Javascript to make it work. Thanks anyways! Link to comment https://forums.phpfreaks.com/topic/148422-send-data-to-next-webpage-in-redirect/#findComment-779300 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.