Jump to content

Alternative For Globals


mnielsen

Recommended Posts

Hi, I have my script up and running, everything works fine but my friend keeps telling me to stop using globals cause there a security risk. He also said that I can use a function as the alternative to a global.

 

Does anyone no if there is any truth in my friend’s words, and if so could you point me in the right direction so I can finally shut him up LOL.

 

Thanks in advance for any help.

P.S I would ask my friend for help but I told him that he’s fill of it =]

Link to comment
https://forums.phpfreaks.com/topic/101428-alternative-for-globals/
Share on other sites

You need to be more specific about what you are using and show an example.

 

Register globals were a huge security hole, were turned off by default in php4.2 and have been eliminated in php6.

 

The $GLOBALS array and the global keyword, used inside of functions, allow poorly written functions to work and should not be used either.

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.