I am following a PHP tutorial from VTC.com. So far all the code that I tested worked fine.
I am now writing a simple search HTML page that is supposed to pass the parameter named “name” to a PHP page; and the way I am testing to see if the parameter was passed to the PHP page successfully is to have a simple echo $name statement on the PHP page. However I am getting the following error :-\ : Notice: Undefined variable: name in c:\inetpub\wwwroot\php_site\resultsbyname.php on line 2
Here is the code for my search page searchbyname.html:
**
[HEAD]
[TITLE]Vinyl Dealers: search[/TITLE]
[/HEAD]
[BODY]
[H2]Search for a shop[/H2]
[BR]
[FORM ACTION="resultsbyname.php" METHOD="POST"]
[INPUT NAME="name" TYPE=TEXT]
[BR]
[INPUT TYPE=SUBMIT VALUE="Search"]
[/FORM]
[/BODY]
**
(i replaced < and > with [ and ] in the above code because if I didn’t the code would have executed)
And here is the resultsbyname.php page that is supposed to display whatever I type inside the input box on the search page:
**
[?
echo $name;
?]
**
(i replaced < and > with [ and ] in the above code.)
I have no idea what is wrong! This should be easy. I can’t go on with the tutorial until I fix this problem. All the code above is exactly as it is on the tutorial from vtc.com
Anyone know why I am having this problem??:q: