MyBB Hacks

Full Version: Adding header to a new php script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,
I'm not really a coder so this is really troubling me at the moment. I was hoping someone here would have a simple solution on how to achieve what i'm trying to do.

I have this new php script that I wanted to add to my forums, all the php and html is inside this one php file. Now I also want to add my mybb header and footer to the page as well.

I added this at the top of the php script:

PHP Code:
define('IN_MYBB', 1); 
define('THIS_SCRIPT', 'bans.php');

require "./global.php";


Then down the script I added:

PHP Code:
echo "<html>\n<head>'{$headerinclude}'\n";


However it does not display my header at all. I'm not even sure if this is the way to go about it but it was just a complete guess on my part. Do you guys know a simple way I can get the header in there?

Cheers!

You can use $header and $footer variable for displaying MyBB's header and footer.
Ahh i'm a fool, that worked. Thanks so much RateU!
Reference URL's