passing values?? between pages


i can't seem to be able to pass values from one page to another..
ok, i start with a HTML page with a form, then submit the info to the .php file..
the .php can't seem to read the variables?

here is the .html code
please advise..

is there some config i didn't do to the server?


<META NAME="Generator" CONTENT="EditPlus">
<form action = "form.php" method = "get">
<table align = "center" border = 1 >

<TD><font size=5><b>name</b></font></TD>
<TD><input type="text" name="name" size ="20"></TD>

<TD><font size=5><b>phone number</b></font></TD>
<TD><input type="text" name="phone" size="20"></TD>

<TD width="134" height="38" align="center">
<input type="submit" value="Yes" name="Yes"></TD>
<TD width="190" height="38" align="center">
<input type="Reset" value="Reset" name="reset"></TD>

here is the .php code


echo"<table align=center>";
echo"<TR><TD><font size=5>name</font></TD>";
echo"<TD><font size=5>$name</font></TD>";
echo"<TR><TD><font size=5>phone number</font></TD>";
echo"<TD><font size=5>$phone</font></TD>";

--It is now proved beyond doubt that smoking is one of the leading causes of statistics.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

you have to use:
and you're fine :)
Do pull them out of the string though, like this:


echo"<table align=center>";
echo"<TR><TD><font size=5>name</font></TD>";
echo"<TD><font size=5>" . $_GET['name'] . "</font></TD>";
echo"<TR><TD><font size=5>phone number</font></TD>";
echo"<TD><font size=5>" . $_GET['phone'] . "</font></TD>";

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
systemxAuthor Commented:
ahh .. it works!
but why do i have to use $GET?
in the text book, they don't use get?

thanks anyways?
old book?

depends on server configuration if you can do without $_GET or not.
with allways works, so you're better of using $_GET['name'] all the time (then it will work on all servers).
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Peter MonkWeb and IT developerCommented:

It depends on which version of PHP you're using.

Anything past about 4.1.0 you'll need to use $_GET, $_POST, etc.
Your manual may have been written for an older version...?

You have to use get if you have global variables turned off in your php.ini file.  It is off by default, which is good because it can lead to security problems.  Stick with $_GET
systemxAuthor Commented:
Ahah! thanks guys..
yeah, my book is using version
i have a new book now.. i will burn the other one for wasting my time!!
thanks again..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.