Posted by James on 10/12/05 23:35
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]
|