Jump to content

Archived

This topic is now archived and is closed to further replies.

e33basketball

Won't recognize variables in the URL

Recommended Posts

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

Share this post


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

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

Share this post


Link to post
Share on other sites
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.

Share this post


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

Share this post


Link to post
Share on other sites

×

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.