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 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> 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! 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? 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) 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. Link to comment https://forums.phpfreaks.com/topic/248661-form-memory/#findComment-1277125 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.