horseatingweeds Posted July 28, 2007 Share Posted July 28, 2007 How do you put posted values back into form inputs if validation fails. I've tried this: <input type='text' name='title' size='30' maxlength='70' value='<?php echo $_SERVER['title']; ?>' /><br /> This causes '<br />' to appear in the input box though. I have no idea why. I figure this is an easy question. I'm not the only one who doesn't want their users to have to fill in a whole new for because of one mistake and not be able to see the mistake. Link to comment https://forums.phpfreaks.com/topic/62154-keeping-values-in-form-inputs-after-validation/ Share on other sites More sharing options...
hostfreak Posted July 28, 2007 Share Posted July 28, 2007 Use the $_POST Superglobal: <input type='text' name='title' size='30' maxlength='70' value='<?php echo $_POST['title']; ?>' /> Link to comment https://forums.phpfreaks.com/topic/62154-keeping-values-in-form-inputs-after-validation/#findComment-309429 Share on other sites More sharing options...
horseatingweeds Posted July 28, 2007 Author Share Posted July 28, 2007 Well that was a stupid mistake.... Thanks for pointing that out for me hostfreak. Link to comment https://forums.phpfreaks.com/topic/62154-keeping-values-in-form-inputs-after-validation/#findComment-309435 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.