boxcar182 Posted July 15, 2006 Share Posted July 15, 2006 i've just been looking through my php.ini file and i just read the part that goes.[QUOTE]; You should do your best to write your scripts so that they do not require; register_globals to be on; Using form variables as globals can easily lead; to possible security problems, if the code is not very well thought of.register_globals = Off[/QUOTE] but doesn't register globals have to be on to include pages like /?id=page here.is there a way to get links working like that with register globals on then? Quote Link to comment https://forums.phpfreaks.com/topic/14675-register-global-questions/ Share on other sites More sharing options...
hvle Posted July 15, 2006 Share Posted July 15, 2006 no, you do not need register global on to enable any particular feature.assume you have this kind of passing:index.php?id=page&username=mynameand you want to print the username out.with register global on, simplyecho $username;without register global on,echo $_GET['username'];relying on register global is generally not good style. There're many reason for it.Bottom line is, accessing your GET and POST data via $_GET and $_POST Quote Link to comment https://forums.phpfreaks.com/topic/14675-register-global-questions/#findComment-58509 Share on other sites More sharing options...
wildteen88 Posted July 15, 2006 Share Posted July 15, 2006 When register_globals is off you have to use a set of predifined variables called superglobals. The following are the superglobas:$_POST, $_GET, $_SESSION, $_COOKIe, $_SERVERBasically to get session data you use $_SESSION, for cookies you use $_COOKIE, for server variables you use $_SERVER, for get/post'd data you you use $_GET or $_POST Quote Link to comment https://forums.phpfreaks.com/topic/14675-register-global-questions/#findComment-58553 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.