I've just started learning PHP and have already hit a bug I can't figure out. I'm trying to write a program that accepts input from the address bar and alters the output accordingly. Here is a simplified form of the script:
Code:
<html>
<head>
<title>PHP test page</title>
</head>
<body>
<?php
if ($Name == "Bob") {
print ("Welcome Bob.");
} else {
print ("Hello there.");
}
?>
</body>
</html>
The idea is that when the user types just the name of the file (say "test.php" into the address bar the out is "Hello there." but when he type "test.php?Name=Bob" the output is "Welcome Bob." The server I'm running it on is one I set up myself with Slackware 10.1 running Apache 1.3.33 and PHP 4.3.10. Unfortunately the program only outputs "Hello there." and typing "test.php?Name=Bob" doesn't achieve the desired effect. PHP is working on the server as I get expected output without the Name parameter but adding "Name=Bob" doesn't work. Is there something wrong with my script or is it possible that my server is misconfigured somehow?