Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.