Posted by Anthony Dodds on 10/12/05 23:46
register globals issue
in hello-web.php replace $frmName with $_POST['frmName']
Regards And good luck
Anthony
"James" <jmessick@triad.rr.com> wrote in message
news:0se3f.1248$Sg2.199921@twister.southeast.rr.com...
> I'm just beginning my PHP studies and one of the first tutorials gives
> different results. The user is prompted for a Name, and PHP is to say
> "Welcome <name>!" on another page. On my hosted server the example works
> fine, but on my own machine the message "Welcome !" is displayed, instead
> of "Welcome James!" (or whatever). The code:
>
> hello-web.htm
>
> <form action="hello-web.php" method="post">
> <td>Name:</td>
> <td><input type="text" name="frmName" size="24">
> <input type="submit" value="Submit">
> </form>
>
>
> hello-web.php
>
> <p>Hello
> <?php echo($frmName); ?>!
>
>
> And from the log:
>
> [client 127.0.0.1] PHP Notice: Undefined variable: frmName in
> C:\\wwwroot\\phpdev\\hello-web.php on line 2, referer:
> http://localhost/phpdev/hello-web.htm
>
> The host system is using an older version of PHP and Apache, but I would
> think the problem is something else. Anyone have an idea? Thanks.
>
> James
[Back to original message]
|