phpbb 2.0 code snippet

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thisbl00d
Forum Newbie
Posts: 13
Joined: Sat Feb 14, 2009 1:17 pm

phpbb 2.0 code snippet

Post by thisbl00d »

Code: Select all

if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']))
{
    die("Hacking attempt");
}
 
:banghead:
can some one pls explain the above snippet in a detailed manner.
what is meant by the parameter 'GLOBALS' given in every associative array?
thnx
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: phpbb 2.0 code snippet

Post by John Cartwright »

It will prevent the user from injecting global variables from $_GET and $_POST and $_COOKIE. This would only be possible with register globals on though.

You can read more about $GLOBALs here
thisbl00d
Forum Newbie
Posts: 13
Joined: Sat Feb 14, 2009 1:17 pm

Re: phpbb 2.0 code snippet

Post by thisbl00d »

John Cartwright wrote:It will prevent the user from injecting global variables from $_GET and $_POST and $_COOKIE. This would only be possible with register globals on though.

You can read more about $GLOBALs here
ty for ur time john
but wat does the parameter passed 'GLOBALS' mean?? if i place the above condition in a new php file apache says GLOBALS is undefined
how will the above condition be true any example code?
Post Reply