PDA

View Full Version : echo name



pauls74462
Jan 18th, 2009, 12:01 AM
<td width="623"> <form name="form1" method="post" action="index.htm">
<p align="center"><input type="text" name="formtext1" size="62"><input type="submit" name="GetDate"></p>
</form>
</td>
</tr>
<tr>
<td width="1218" colspan="2">
<p align="center"><?PHP echo form1 ?></p>
</td>


I'm trying to get a form where it will echo the name you type in the text box when you press submit.

Please help

Common
Jan 18th, 2009, 12:15 AM
<form action="index.php" method="post">
<input type="text" name="inputname">
<input type="submit" value="Submit">
</form>

<?php
if(isset($_POST[inputname])){

echo $_POST[inputname];

}
?>

Save this in a file called index.php and run it on a php enabled server and that will do as you ask.

_Aerospace_Eng_
Jan 18th, 2009, 12:15 AM
This is a php question not an html one.

<?php echo htmlentities($_POST['formtext1']); ?>