Hello,

I just started a MySQL and PHP development tutorial (The tutorial I am following can be found here:
http://www.sitepoint.com/article/525) and I have run into a problem that no amount of searching can find me the answer to.

The code is short and simple but every time I run it I get the same error: Notice: Undefined variable: name in c:\inetpub\wwwroot\phptutorial\welcome.php on line 12

The code that doesn't work is a link from one page (.html) passing a variable to another page (.php) and looks like this:

.html page:

<html>
<head>
<title> Welcome </title>
</head>
<body>
<A HREF="welcome.php?firstname=Kevin&lastname=Yank">
Hi, I'm Kevin Yank! </A>
</body>
</html>

.php page:

<html>
<head>
<title> Welcome </title>
</head>
<body>
<?php
echo( "Welcome to our Web site,
$firstname $lastname!" );
?>
</body>
</html>

All of this code is cut and pasted directly from the tutorial, I don't know how it could be incorrect (although maybe php has changed since this was written).

I feel foolish asking such a basic question. Everything else has worked, including other small and simple 'test' type pages. Any help would be appreciated.

BTW - Win XP Pro, IIS 5.1, PHP 4.3.1 (i used the exe installer)

Thanks,

Jack

    you've proabbly got globals off in php.ini: and also you dont need theose parenthisis in the echo:

    <html> 
    <head> 
    <title> Welcome </title> 
    </head> 
    <body> 
    <?php 
    echo "Welcome to our Web site, ".$_GET['firstname']." ".$_GET['lastname']."!"; 
    ?> 
    </body> 
    </html> 
    

    $GET variables are ones that are encoded with the URL - $POST ones ceom from a form with teh POST method.

      It worked after removing iis and installing Apache, first try.

      Thanks

        Write a Reply...