Jump to content

Can't pass variables in address bar


weenoid

Recommended Posts


Hey, i've been using PHP for about 3 years and i've hit an odd problem. My server was wiped and the software was re-installed the other day and now my PHP files won't pass variables in the address bar.

Example:
<a href="page.php?id=1">click here</a>

If I click this link it won't pass the variable to page.php even though everything looks fine in the address bar. I've tried everything and can only assume that the problem lies with a setting relating to PHP that must have been altered. Any ideas? Thanks :).
Link to comment
Share on other sites

Look at your code and see if you are accessing $id or $_GET['id']. I bet the code is probably trying to access it using $id. That will only work with register_globals on. It's best to keep register_globals off and use $_GET superglobal array variable. See:

[a href=\"http://us3.php.net/register_globals\" target=\"_blank\"]http://us3.php.net/register_globals[/a]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.