MyBB Hacks

Full Version: THIS_SCRIPT
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I write this:

PHP Code:
if(THIS_SCRIPT == 'private.php')
{
die(':-)');
}


A smiley face appears in my screen. But with this:

PHP Code:
if(defined('THIS_SCRIPT') && THIS_SCRIPT == 'private.php')
{
die(':-)');
}


It doesn't... may it be my server configuration or something? I don't get it...

I seriously can't see that happening - there's probably something else.
But if you're still curious, you can try

PHP Code:
die(var_dump(
  defined("THIS_SCRIPT"),
  THIS_SCRIPT,
  THIS_SCRIPT == 'private.php',
  (defined('THIS_SCRIPT') && THIS_SCRIPT == 'private.php')
));

It is working now... I am sure I wrote it right, no sure what happened.
Reference URL's