|
Posted by Gordon Burditt on 10/13/05 04:55
>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:
A POST variable is referenced as $_POST['frmName'].
With reasonably non-ancient versions of PHP, this should work
correctly on both your version and the one used by your host.
Gordon L. Burditt
>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
Navigation:
[Reply to this message]
|