html input and php (newbie)
| From: | Anna Gyor | Date: | Tue, 24 Sep 2002 19:31:22 +0000 |
| Subject: | html input and php (newbie) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117464@lists.php.net to get a copy of this message | ||
Hi,
I just began to learn php and I have te following code. How can I get the
input field value in the php script? Because my script doesn't work.
$UserName is always an empty string.
<?php
if ($submit == "click"){
echo "Hello, $UserName";
}
else{
?>
<html><body>
<form method="post" action="input.php3">
Enter Your Name
<input type="text" name="UserName"></input><br>
<input type="submit" name="submit"
value="click"></input>
<? echo "Hello, $UserName"; ?>
</form>
</body></html>
<?
}
?>