delickate Posted December 8, 2011 Share Posted December 8, 2011 Hi, I've a small form, having two fields username and password. and a checkbox remember. i want to auto fill username and password field if i login by enable checkbox remember. i put following code to do that: if(isset($loginform['txtrememberme'])) { setcookie('txtusername', mysql_real_escape_string($loginform['txtusername']), time()+60*60*72, '/', '', 0); setcookie('txtpassword', mysql_real_escape_string($loginform['txtpassword']), time()+60*60*72, '/', '', 0); } after login, when i logout and come back to login page, it didn't save the values. can anyone help please? Quote Link to comment https://forums.phpfreaks.com/topic/252746-cookies-problem/ Share on other sites More sharing options...
OOP Posted December 8, 2011 Share Posted December 8, 2011 Hi there, Where is the part of your script in which you fill out the form from the cookies? Also, I don't think this is a good idea? What are you trying to achieve by auto filling the form? regards Quote Link to comment https://forums.phpfreaks.com/topic/252746-cookies-problem/#findComment-1295750 Share on other sites More sharing options...
delickate Posted December 8, 2011 Author Share Posted December 8, 2011 Hi, Thanks for reply. I downloaded the script from this website http://www.bitrepository.com/php-autologin.html as i told, i don't want to fill login form for next. when i open the login page, it should auto fill the form. that is what i want to achieve please guide what is the best technique Thanks Quote Link to comment https://forums.phpfreaks.com/topic/252746-cookies-problem/#findComment-1295752 Share on other sites More sharing options...
delickate Posted December 11, 2011 Author Share Posted December 11, 2011 is there any one who know about it? Quote Link to comment https://forums.phpfreaks.com/topic/252746-cookies-problem/#findComment-1296701 Share on other sites More sharing options...
delickate Posted December 11, 2011 Author Share Posted December 11, 2011 Hi, I found the solution by doing this with header. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/252746-cookies-problem/#findComment-1296728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.