Re: html input and php (newbie)
| From: | Juan Pablo Aqueveque | Date: | Tue, 24 Sep 2002 13:36:25 +0000 |
| Subject: | Re: html input and php (newbie) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-117467@lists.php.net to get a copy of this message | ||
What is of your PHP version?
I guess of your directive register_globals = off in your php.ini, so your code would be run OK like this:
<?php
if ($_POST['submit'] )
{
echo 'Hello'.$_POST['UserName'];} ?> --jp At 21:31 24-09-2002 +0200, Anna Gyor wrote:
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> <? } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php________________________________________________________ Juan Pablo Aqueveque <juque@uct.cl> Ingeniero de Sistemas Departamento de Redes y Comunicaciones http://www.drc.uct.cl Universidad Católica de Temuco. Tel:(5645) 205 630 Fax:(5645) 205 628