Jump to content


Photo

Won't recognize variables in the URL


  • Please log in to reply
3 replies to this topic

#1 e33basketball

e33basketball
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 March 2006 - 07:36 AM

Hi,

I have a server running off my PC, mostly for testing... and it has PHP/MySQL installed.
Everything works pretty well, except for some reason it's not recognizing any variables that I put in the URL.
Example...

url = www.site.com/index.php?check=1

if($check == "1"){
echo"one!";
} else {
echo"something else!";
}

no matter what i set check at... i still get "something else" ...

or... if i where to say echo"$check"; ... nothings there....

any ideas...

thanks,

Erik

#2 naskoo

naskoo
  • Members
  • PipPip
  • Member
  • 13 posts
  • LocationBulgaria

Posted 13 March 2006 - 07:54 AM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]if($check == "1"){
echo"one!";
} else {
echo"something else!";
} [/quote]

$_GET['check'] == "1" !!!

#3 e33basketball

e33basketball
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 March 2006 - 08:02 AM

oh cool, thanks... just curious... does this vary from type of PHP installation?... on a shared server that I have through a company... just using $check worked.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 March 2006 - 09:29 AM

How php treats sertain variables depends on one setting in the php.ini file which is the regsiter_globals setting. Your shared hosting account has this set to On (which isn't recommended any more as it can lead to security issues) and you local server has it turn Off which is recommended.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users