There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot browser bsod computer cpu crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware missing monitor network networking outlook outlook 2003 outlook 2007 outlook express password popups problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Good Code Layout?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
dudeking's Avatar
Computer Specs
Senior Member with 344 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
07-Jun-2007, 05:10 PM #1
Solved: Good Code Layout?
Hi just wanted to check this with you lot. I have been structuring all my websites like this for a while now, I find is soo much easer updating things and changing designs. Is this a good way to work?

PHP Code:
<?php
    $site 
"http://safeinaroom.co.uk";
    
$pagename "Home";
    include(
$site.'/include/site/head.php');
    echo 
"
        <title>
            Safe In A Room - $pagename
        </title>
    </head>
    <body>        
    "
;
        include(
$site.'/include/site/top.php');
        include(
$site.'/include/site/hometext.php');
        include(
$site.'/include/site/footer.php');
?>
head.php would contain the doctype meta tags css ect

top.php is the header links etc

the middle include has the page info in it

and foot.php just closes off all the table tags etc and of cause has the footer in.
__________________
Thanks, Eddie
www.dudeking.co.uk
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,196 posts.
 
Join Date: Oct 2006
08-Jun-2007, 04:08 AM #2
Yeah, thats what I did to my site.

There is no reason to put $site in your includes.
dudeking's Avatar
Computer Specs
Senior Member with 344 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
08-Jun-2007, 06:14 AM #3
will it work? My site didnt used to work with out DOCUMENT_ROOT. So I changed it to $site.

Do I just need a / at the start then?
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,196 posts.
 
Join Date: Oct 2006
08-Jun-2007, 07:01 AM #4
Yup, if '/include/site/top.php' doesn't work than use './include/site/top.php'
dudeking's Avatar
Computer Specs
Senior Member with 344 posts.
 
Join Date: Feb 2007
Location: UK, Midlands
Experience: I'm Pro...
08-Jun-2007, 07:05 AM #5
Okay! Thanks
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,196 posts.
 
Join Date: Oct 2006
08-Jun-2007, 10:00 AM #6
np.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:10 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.