GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   need help with PHP. Who do you pass variable through text field. (https://gfy.com/showthread.php?t=780431)

Phil 10-29-2007 04:51 PM

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

dissipate 10-29-2007 05:02 PM

echo $_POST['formvariablename'];

Tempest 10-29-2007 05:04 PM

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>


Phil 10-29-2007 05:28 PM

thank you. works great

quantum-x 10-29-2007 05:53 PM

Don't trust htmlentities.


All times are GMT -7. The time now is 12:30 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123