Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters in URL (?var=value) 1

Status
Not open for further replies.

lewisd

Programmer
Jun 25, 2002
1
US
I'm new to PHP, so this could be a stupid question..
But why won't this work?

(Some.html)
<a href=&quot;/error.php?e=error1&quot;>error</a>

(error.php)
<?
print(&quot;error code &quot;.$e);
?>

Yields this on browser (IE5)
error code

From the documentation it looks like I should automatically have a variable $e and it should have the value &quot;error1&quot;. What gives? this is with PHP and Apache on Win2k. tia.
 
If you do not have register_globals turned on in your PHP configuration, the GET-method variable will not be available as $e.

If you are using PHP > 4.1.0, try using $_GET[&quot;e&quot;]

If you are using an older PHP version, use $HTTP_GET_VARS[&quot;e&quot;]. ______________________________________________________________________
Don't say thanks. Just award stars.
______________________________________________________________________
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top