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 (1 - 4)
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.
 
GunsNRachel
post May 28 2008, 09:00 PM
Post #3


Senior Member
****

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



Does that code have to go into a PHP file? Or is it supposed to be HTML?
 
Melissa
post May 28 2008, 09:03 PM
Post #4


;)
******

Group: Duplicate
Posts: 2,374
Joined: Feb 2004
Member No: 3,760



php
 
synatribe
post May 28 2008, 09:05 PM
Post #5


AIDS at RAVES.
******

Group: Official Designer
Posts: 2,386
Joined: Dec 2007
Member No: 598,878



there are also dynamic inclusions
heres a tutorial:

http://inobscuro.com/tutorials/read/16/
 

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