hostfreak Posted September 11, 2006 Share Posted September 11, 2006 I was wondering, on one of the hosting accounts I have, I have to use[code]$_GET['variable'];[/code]To retrieve something from the url parameters. Whilst on another hosting account I have, I don't have to use $_GET. Why is that? Quote Link to comment https://forums.phpfreaks.com/topic/20377-_get-question/ Share on other sites More sharing options...
radalin Posted September 11, 2006 Share Posted September 11, 2006 you always need to define if the variable is coming from post or get or a cookie or a session or whatever. If you don't, php will accept it as a new variable which will cause a problem of values.Maybe you don't need to write $_GET but $_HTTP_GET_VARS. That is because o different versions of php Quote Link to comment https://forums.phpfreaks.com/topic/20377-_get-question/#findComment-89737 Share on other sites More sharing options...
wildteen88 Posted September 11, 2006 Share Posted September 11, 2006 The other host has a setting called register_globals enabled. You can still use $_GET['variable'] to access the variables from the URL if your other hosts is using a PHP version greater the PHP4.3. Quote Link to comment https://forums.phpfreaks.com/topic/20377-_get-question/#findComment-89739 Share on other sites More sharing options...
obsidian Posted September 11, 2006 Share Posted September 11, 2006 [quote author=wildteen88 link=topic=107631.msg432018#msg432018 date=1157976385]The other host has a setting called register_globals enabled. You can still use $_GET['variable'] to access the variables from the URL if your other hosts is using a PHP version greater the PHP4.3.[/quote]indeed, but keep in mind that it is highly suggested [b]not[/b] to have register_globals enabled. you should always write your code in such a way as to work without it enabled since, as wildteen hinted at, as of PHP 4.3, it is disabled by default. Quote Link to comment https://forums.phpfreaks.com/topic/20377-_get-question/#findComment-89750 Share on other sites More sharing options...
hostfreak Posted September 11, 2006 Author Share Posted September 11, 2006 Makes sense now guys. Thanks. One host has php version 4.2 and the other had 4.4 . As you guys know (and I do now) the one with the 4.4 dindn't work. Well, I am off to recode it now. Quote Link to comment https://forums.phpfreaks.com/topic/20377-_get-question/#findComment-89754 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.