Adding header to a new php script
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #1
Adding header to a new php script
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!

07-28-2012 06:35 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Adding header to a new php script
You can use $header and $footer variable for displaying MyBB's header and footer.

07-28-2012 07:41 AM
Find all posts by this user Quote this message in a reply
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #3
RE: Adding header to a new php script
Ahh i'm a fool, that worked. Thanks so much RateU!
(This post was last modified: 07-28-2012 09:08 AM by mdb.)
07-28-2012 08:53 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: