nightrain Posted May 10, 2008 Share Posted May 10, 2008 I have a basic form that sends user preferences to a database. I'd like to make it so that when the user revisits the page, the form is pre-filled with their preferences. lets say the form looks like this: <form action="index.php" method="post"> <select name="color"> <option value="" selected>select one</option> <option value="red">Red</option> <option value="blue">Blue</option> </select> <input name="submit" type="image" value="submit"> </form> other necessary info: hostname = localhost username = username password = password database name = database table name = table primary key = user colors row = color given the above, can anyone help me with a sample script that will prefill the color field using the database? thanks for your help! Link to comment https://forums.phpfreaks.com/topic/104977-pre-fill-form-help/ Share on other sites More sharing options...
perezf Posted May 10, 2008 Share Posted May 10, 2008 Try storing the information in cookies Link to comment https://forums.phpfreaks.com/topic/104977-pre-fill-form-help/#findComment-537339 Share on other sites More sharing options...
nightrain Posted May 10, 2008 Author Share Posted May 10, 2008 thanks but can you give me an example? is that as reliable as using the database? Link to comment https://forums.phpfreaks.com/topic/104977-pre-fill-form-help/#findComment-537353 Share on other sites More sharing options...
nightrain Posted May 14, 2008 Author Share Posted May 14, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/104977-pre-fill-form-help/#findComment-540615 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.