need help with PHP. Who do you pass variable through text field.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Phil
    Confirmed User
    • Jan 2004
    • 7659

    #1

    need help with PHP. Who do you pass variable through text field.

    page_one.php where I have text field for user to enter text..
    form action page_one.php where I echo their text.


    Im having brain fat and can't think
    Ask Phil
  • dissipate
    The Dirty Frenchman
    • Nov 2005
    • 8904

    #2
    echo $_POST['formvariablename'];

    Comment

    • Tempest
      Too lazy to set a custom title
      • May 2004
      • 10217

      #3
      Not sure if this is the type of thing you're looking for or not... "should" work but I didn't test it.
      Code:
      <html>......
      <form action="page_one.php" method="POST">
      <p><input type="text" name="sometext" value="" size="30" /></p>
      <p><input type="submit" name="subbutton" value="Submit It" /></p>
      </form><br />
      <?php
      	if(isset($_POST['subbutton']) && isset($_POST['sometext']) && trim($_POST['sometext']) != ''){
      		echo("<p>".htmlentities($_POST['sometext'])."</p>\n");
      	}
      ?>
      .....
      </html>

      Comment

      • Phil
        Confirmed User
        • Jan 2004
        • 7659

        #4
        thank you. works great
        Ask Phil

        Comment

        • quantum-x
          Confirmed User
          • Feb 2002
          • 6863

          #5
          Don't trust htmlentities.
          PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

          Comment

          Working...