DeX Posted August 11, 2010 Share Posted August 11, 2010 I've got a form that submits values to itself and the user input values are saved into the database in a table with an auto incrementing ID. After SUBMIT is clicked, it reloads the page and all the values are gone, I'm wondering how I can get it to keep the values so that the user can make a single change and resubmit again. I know I can save all the values into the session or in the URL or pass them through $_POST in an array but I'm wondering what is the proper way to do this. Thanks. Link to comment https://forums.phpfreaks.com/topic/210466-how-do-i-get-a-form-to-keep-its-values-after-submit/ Share on other sites More sharing options...
wildteen88 Posted August 11, 2010 Share Posted August 11, 2010 If you're submitting the form to itself, then you can do something like this echo '<input type="text" name="field_name" value="' . (isset($_POST['field_name']) ? $_POST['field_name'] : '') . '" />'; Link to comment https://forums.phpfreaks.com/topic/210466-how-do-i-get-a-form-to-keep-its-values-after-submit/#findComment-1098195 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.