Jump to content

register_global Question?


Trium918

Recommended Posts

I would like to include this into all my files. Would this be a security hazard? If so,
how and what could I do to improve it?
<?php
/************************************************************/
/* If register_globals is not set then import them	    */
/* Import GET/POST/Cookie variables into the global scope   */
/************************************************************/
if (!ini_get('register_globals')) {
@import_request_variables("GPC", "");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/88758-register_global-question/
Share on other sites

There is a reason why register globals is turned off by default in PHP5 and removed in PHP6. It's bad style and opens up for a variety of security issues. Just use the superglobals.

 

I understand that, but you still haven't answered my question?

I have register_globals = Off inside of my php.ini.

 

Is import_request_variables turning register_global = On or is it

just importing them. I am trying to build a Content Management System,

so I would hate to use superglobals $_GET $_POST etc.. in each file. 

 

Thanks!

Archived

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

×
×
  • Create New...

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.