jaArch Posted October 7, 2011 Share Posted October 7, 2011 Hi: How do I set up an input textbox so that it remembers the text a user entered? <form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>" > <input name="myguess" type="text" value=""> <input type="hidden" name="allTheGuesses" value = ""> <input type="submit" value="GUESS"> </form> I can't seem to figure it out Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/ Share on other sites More sharing options...
The Little Guy Posted October 7, 2011 Share Posted October 7, 2011 <form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>" > <input name="myguess" type="text" value="<?php echo $_POST['myguess']; ?>"> <input type="hidden" name="allTheGuesses" value = "<?php echo $_POST['allTheGuesses']; ?>"> <input type="submit" value="GUESS"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277077 Share on other sites More sharing options...
jaArch Posted October 7, 2011 Author Share Posted October 7, 2011 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277079 Share on other sites More sharing options...
jaArch Posted October 7, 2011 Author Share Posted October 7, 2011 Also: What is a $_POST PHP variable? Could I get an example to further help me understand? Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277083 Share on other sites More sharing options...
The Little Guy Posted October 7, 2011 Share Posted October 7, 2011 http://us2.php.net/manual/en/reserved.variables.post.php An associative array of variables passed to the current script via the HTTP POST method. $HTTP_POST_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_POST_VARS and $_POST are different variables and that PHP handles them as such) Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277098 Share on other sites More sharing options...
MasterACE14 Posted October 8, 2011 Share Posted October 8, 2011 $HTTP_POST_VARS contains the same initial information, but is not a superglobal. (Note that $HTTP_POST_VARS and $_POST are different variables and that PHP handles them as such) Also keep in mind $HTTP_POST_VARS is deprecated. Quote Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277125 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.