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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to parse data passed by URL 1

Status
Not open for further replies.

arm207

Programmer
Jun 13, 2006
26
US
when I try to pass data thru URL using embedded links, the receving page doesn't automatically populate the php variables. Does anyone know why?

for example...
<a href="test.php ?name=bob&amp;gender=male">name and gender</a>

The $name and $gender come out to be blanks? Any suggestions?
 
Yes, automatically populating the variables is done via register_globals, which is a setting in php.ini that used to be set to on in older installations of php. Due to security issues, this was changed to off in later installations. It is very smart to keep it off, both for security as well as understanding of code. The variables are still available in the superglobal arrays that correspond to the method via the variables were sent to the other page. In your case, your vars would be found under:
$_GET['name']
$_GET['gender']
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top