Activity Stream
48,167 MEMBERS
6861 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    Respected Member

    Default PHP Include (How To Template Your Site)

    These are awesome for making headers/footers/same thing on many pages. It will save you from having to change the same thing on many pages. Rather then doing that, with a few characters of code ( <?php include 'footer.php'; ?> ) you will only need to modify one document to change whatever it is on every page.


    Lets assume this is your site and you need to modify the footer. You have over 300 pages. That would be a pain in the ass.

    Code: 
    <html>
    <head>
    <title>My Site</title>
    </head>
    
    <body>
    
    <center>My Site Sections here: Awesome Section 1/Super cool stuff/Even better things</center>
    <br><br>
    This is such a super cool site that you want to copy it. Look how much info is here in my main section
    <br>
    <br>
    Copyright 2011 My super cool site<br>
    </body>
    
    </html>
    Every file will need to be made into php

    First thing you need to do is make a header.php file. All the info from your header is included in that file.
    Code: 
    <html>
    <head>
    <title>My Site</title>
    </head>
    
    <body>
    
    <center>My Site Sections here: Awesome Section 1/Super cool stuff/Even better things</center>
    <br><br>
    Next is the footer. Everything that you want to keep in the footer. Usually copyright info or footer links

    Code: 
    <br>
    <br>
    Copyright 2011 My super cool site<br>
    </body>
    
    </html>
    w00t! almost there. Now you need to call these pages you just made.

    make an index.php file and call up the files you just made. You will see using this will save you a ton of time if you have many pages.
    Code: 
    <?php include 'header.php'; ?>
    
    This is such a super cool site that you want to copy it. Look how much info is here in my main section
    
    <?php include 'footer.php'; ?>
    You're not just limited to using this as a header/footer. You can use it for mid-page info as well. I use it for damn near everything.
    Jesse Reviewed by Jesse on . PHP Include (How To Template Your Site) These are awesome for making headers/footers/same thing on many pages. It will save you from having to change the same thing on many pages. Rather then doing that, with a few characters of code ( <?php include 'footer.php'; ?> ) you will only need to modify one document to change whatever it is on every page. Lets assume this is your site and you need to modify the footer. You have over 300 pages. That would be a pain in the ass. <html> <head> <title>My Site</title> </head> Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    Tastro.org HDTVXviDLOL.com EpisodeSeasons.com FileBorg.org W-47.com
    ye goog job... you just should have a variable on each page, which tells php how the title of the page should look like... else the title on all pages will be the same... and that's not good for SEO.
    LE with your pr2 site? <a href="http://tastro.org/">Tastro.org</a> or link exchance with our category page: <a href="http://tastro.org/i/hdtv">HDTV</a> | <a href="http://tastro.org/i/dvdrip">DVDRip</a> | <a href="http://tastro.org/i/r5">R5</a> | <a href="http://tastro.org/i/bdrip">BDRip</a> | <a href="http://tastro.org/i/brrip">BRRip</a>

  4.     
    #3
    Member
    thank you very much!

  5.     
    #4
    Respected Member
    Quote Originally Posted by sloddl View Post
    ye goog job... you just should have a variable on each page, which tells php how the title of the page should look like... else the title on all pages will be the same... and that's not good for SEO.
    Yup. Or you can start the header template below the <title></title>. You'd just need to change what's included in the header.php

    <html>
    <head>
    <title>My Site</title>
    </head>
    <?php include 'header.php'; ?>

    This is such a super cool site that you want to copy it. Look how much info is here in my main section

    <?php include 'footer.php'; ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Selling] Post Button (Include PSD)
    By Samar in forum Services
    Replies: 0
    Last Post: 26th Aug 2012, 06:08 PM
  2. Use php include for certain div of the page
    By igordr in forum Web Development Area
    Replies: 9
    Last Post: 25th Aug 2012, 05:54 PM
  3. [Selling] 4 Website for Sale (include 2 PR2 + 1 PR1)
    By freehealthylife.com in forum Completed Transactions
    Replies: 5
    Last Post: 28th Sep 2011, 11:05 AM
  4. vbulletin 4 php include
    By Klinzter in forum Webmaster Discussion
    Replies: 0
    Last Post: 31st Aug 2011, 09:13 PM
  5. Replies: 0
    Last Post: 13th Jan 2008, 01:32 AM

Tags for this Thread

BE SOCIAL