tommyboy123x Posted September 2, 2007 Share Posted September 2, 2007 How do other sites make it so that when you fill out a form and you mess something up (e.g. the password / verify password are not the same), the values are still in the input box? I could throw out a bunch of sites that do this... even registering for this forum, web.com, and almost every other place. For a while firefox would autosave it on my site so that when you click back it is waiting for you, but i put in this javascript / php text replacement thing that interferes with that because it generates an image every time the page is loaded so it is not all in the cache or something like that... Link to comment https://forums.phpfreaks.com/topic/67630-solved-refill-form-values/ Share on other sites More sharing options...
Guest Posted September 2, 2007 Share Posted September 2, 2007 Well, you can save the information in a cookie, or a session (usually its a cookie), and then load the information from the cookie, if it exists. Link to comment https://forums.phpfreaks.com/topic/67630-solved-refill-form-values/#findComment-339743 Share on other sites More sharing options...
sirish Posted September 2, 2007 Share Posted September 2, 2007 Once you clicked submit button the values entered in the form is stored in $_POST or $_GET as per your method of the form. So in order to retreive the previously entered value, try the following Suppose the name of your textfield is "username" For method=POST <input name="username" type="text" id="name" value="<?=$_POST['name']?>" /> For method=GET <input name="username" type="text" id="name" value="<?=$_GET['name']?>" /> :) Link to comment https://forums.phpfreaks.com/topic/67630-solved-refill-form-values/#findComment-339756 Share on other sites More sharing options...
tommyboy123x Posted September 2, 2007 Author Share Posted September 2, 2007 From a security standpoint, i thought that the $_POST might be a bad thing. Obviously i won't be doing it with the password as it is already encrypted but i guess theres no risk for things like username. Thanks Link to comment https://forums.phpfreaks.com/topic/67630-solved-refill-form-values/#findComment-340053 Share on other sites More sharing options...
Hypnos Posted September 2, 2007 Share Posted September 2, 2007 The only way to securely get and send passwords is HTTPS/SSL. Anything else is not encrypted. With HTTPS/SSL everything is. It's all or nothing. Link to comment https://forums.phpfreaks.com/topic/67630-solved-refill-form-values/#findComment-340056 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.