Hi folks,
I'm running PHP version 4.3.4 on a LAMP (That's what's on my hosting site)
I'm working my way through Sam's Learn PHP in 24 Hours and after a week and a half (roughly 50 hours of effort, thanks Sam) I'm on Hour 9: Forms (each one hour lesson's been taking me like 5 or 6 hours to complete...anyway)
It's a good book and I feel like I'm slowly building a solid understanding of the relatively easy concepts in the beginning of the book: Hour 6 was functions, Hour 7 Arrays, Hour 8 classes, and now hour 9 is Forms. I've run across bugs which I had to solve and even some typos in the book (in the code!) which I solved and up til now I've been able to get all tutorial examples working.
That is, until now...I need your help!
In the latest example I'm supposed to setup a form in one short script which asks user for name and address, and then upon hitting submit button that script calls another in the same folder and a page comes up which reads you back your name and address...simple, in principle. but for whatever reason my new page is not allowing me to print the variables passed to it by the first page. I know the first page is properly passing the variables because i can see the variables in the browser address bar of the second page.
Here's my code. Anyone can point out my blaring mistake???
<html>
<head>
<title>We're onto dealing with Forms folks...for accepting User input</title>
</head>
<BODY>
<b>
Accepting User Input through Forms<br><br>
</b>
<form action="formaddress.php" method="GET">
<input type="text" name="user">
<br>
<textarea name="address" rows="5" cols="40">
</textarea>
<br>
<input type="submit" value="hit it!">
</form>
</body>
</html>
========and here's the one it calls up "formaddress.php"=====
<html>
<head>
<title>We're onto dealing with Forms folks...for accepting User input</title>
</head>
<BODY>
<b>
Reading User input through the Form<br><br>
</b>
<?php
print "Welcome <b>$user</b><p>\n\n";
print "Your address is:<p>\n\n<b>$address</b>";
print "<br>";
print "<br>";
print "$user";
print "<br>";
print "$address";
print "<br>";
print "This should be printing name and address...";
print $user;
print $address;
?>
</body>
</html>
=====================
Basically I tried printing the variables $user and $address in many different ways, just to make sure my problem wasn't a simple syntax problem.
What I get in the resulting browser is all the text and no variables. I don't get any error messages. Thanks for you help so I can move on further in the book. <html>