weenoid Posted March 28, 2006 Share Posted March 28, 2006 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 :). Quote Link to comment https://forums.phpfreaks.com/topic/5980-cant-pass-variables-in-address-bar/ Share on other sites More sharing options...
toplay Posted March 28, 2006 Share Posted March 28, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/5980-cant-pass-variables-in-address-bar/#findComment-21439 Share on other sites More sharing options...
txmedic03 Posted March 28, 2006 Share Posted March 28, 2006 Well the first one that springs to mind is are you relying on register_globals? If you are you need to change your code so you do not need it. Quote Link to comment https://forums.phpfreaks.com/topic/5980-cant-pass-variables-in-address-bar/#findComment-21448 Share on other sites More sharing options...
weenoid Posted March 28, 2006 Author Share Posted March 28, 2006 Perfect! Thanks a lot guys. Sorry for asking such a n00b question, but i've never come across this before. Thanks again for the help. Quote Link to comment https://forums.phpfreaks.com/topic/5980-cant-pass-variables-in-address-bar/#findComment-21494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.