mnielsen Posted April 16, 2008 Share Posted April 16, 2008 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 More sharing options...
p2grace Posted April 16, 2008 Share Posted April 16, 2008 When you say globals do you mean in calling a global variable within a class function, or are you talking about a define() variable? Link to comment https://forums.phpfreaks.com/topic/101428-alternative-for-globals/#findComment-518855 Share on other sites More sharing options...
PFMaBiSmAd Posted April 16, 2008 Share Posted April 16, 2008 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. Link to comment https://forums.phpfreaks.com/topic/101428-alternative-for-globals/#findComment-518857 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.