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. Quote 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'] : '') . '" />'; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.