Jump to content

Form memory


jaArch

Recommended Posts

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

      <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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.