Log In · Register

 
PHP includes..
GunsNRachel
post May 28 2008, 02:10 PM
Post #1


Senior Member
****

Group: Member
Posts: 292
Joined: Jul 2007
Member No: 545,047



I meant including! I'm having issues today =(

Anyway, how do I go about using php including for my website layout? Do I just put the whole layout on one php page? Or do I have to do it in sections. I'm using divs, so how does that work?

I'm really confused huh.gif
 
 
Start new topic
Replies
fixtatik
post May 28 2008, 03:30 PM
Post #2


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



PHP includes are fairly easy. basically, you'll make a file for your header, your footer and your sidebar (if you have one).
CODE
<? include('header.php'); ?>
<div>
  put all your page information here.
</div>
<?
include('sidebar.php');
include('footer.php');
?>

a template like that is assuming that the header, sidebar and footer files are in the index directory, and not in any other folders. if they were in other folders, you'd simply add "foldername/header.php" etc.

you can always mix and match as well - this is just a general idea.
 

Posts in this topic
GunsNRachel   PHP includes..   May 28 2008, 02:10 PM
grrDesign   PHP includes are fairly easy. basically, you'l...   May 28 2008, 03:30 PM
GunsNRachel   Does that code have to go into a PHP file? Or is i...   May 28 2008, 09:00 PM
heartquasm   php   May 28 2008, 09:03 PM
SkyliteX   there are also dynamic inclusions heres a tutorial...   May 28 2008, 09:05 PM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: