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 <[EMAIL PROTECTED]>
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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to