# What is this PHP doing?

**URL:** <https://forum.kirupa.com/t/what-is-this-php-doing/180268>\
**Category:** Uncategorized\
**Created:** [February 27, 2006, 1:11pm UTC](https://forum.kirupa.com/t/what-is-this-php-doing/180268 "2006-02-27T13:11:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)\
**Post date:** [February 27, 2006, 1:11pm UTC](https://forum.kirupa.com/t/what-is-this-php-doing/180268/1 "2006-02-27T13:11:50Z")

</div>

This is the first lines in the index.php page of phpbb2.

What exactly is the extension.inc doing ?  
And these lines from common.  
I know they are to stop hacking attempts… But what sort are they stopping.

```php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

```

```php

/*
extension.inc
$Id: extension.inc,v 1.5 2002/04/04 11:52:50 psotfx Exp $
*/ 
if ( !defined('IN_PHPBB') )
{
    die("Hacking attempt");
}
// Change this if your extension is not .php!
$phpEx = "php";

$starttime = 0;

```

```php

// Protect against GLOBALS tricks
if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']))
{
    die("Hacking attempt");
}

```

```php

// Protect against HTTP_SESSION_VARS tricks
if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS))
{
    die("Hacking attempt");
}

```
