passing values?? between pages

Posted on 2003-10-22
Medium Priority
Last Modified: 2013-12-03

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.
Question by:systemx
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

DoppyNL earned 360 total points
ID: 9597447
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>";

Author Comment

ID: 9597525
ahh .. it works!
but why do i have to use $GET?
in the text book, they don't use get?

thanks anyways?

Expert Comment

ID: 9597552
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).
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.


Expert Comment

by:Peter Monk
ID: 9597575

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...?


Expert Comment

ID: 9602451
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

Author Comment

ID: 9612814
Ahah! thanks guys..
yeah, my book is using version 3.xxx
i have a new book now.. i will burn the other one for wasting my time!!
thanks again..

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question