SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member Maximus's Avatar
    Join Date
    Oct 2001
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Should I use PHP include

    Hi there everyone,

    Currently, I have a navigation bar which I have very badly included in the top of every page on my site. Bad idea as I have found out recently when I wanted to update a link and had to up date the whole site. Doh!

    My question is should I use PHP include instead to embed my header? I suppose then I could have one navigation file and just use the include to embed it in the top of every page. Is this a better way of doing it? How much will it slow down the page loading?

    Maximus
    Maximus
    Sheffield Sport
    http://www.solidsport.co.uk

  2. #2
    SitePoint Zealot pnathan's Avatar
    Join Date
    Sep 2001
    Location
    Amsterdam
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use php include throughout my site. I recommend that you use it. You will not notice to any difference in the speed of your site. Anyway, any tiny lose of performace is far outweighed by the ease of maitainence that the using include files provide.
    I have two tickets to the Crows, sweet.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using PHP anywhere else on your site? If not then you might not need the PHP include function. Server Side Includes work just fine for that.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Using includes is recommended if you aren't doing entirely server side processing.

    The only thing to be wary of is using too many. I've seen people go hyper on includes and use 20+ per page... Don't! Try and stay at 2-3 at most.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    SitePoint Member Maximus's Avatar
    Join Date
    Oct 2001
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for the advice!

    Thank you kindly for the advice.

    In answer to your question I do have a little bit of PHP already running on my feedback page so I know PHP include is supported/running.

    Thanks again guys. And thanks for the very quick response, much appreciated.

    Thanks,
    Maximus
    Sheffield Sport
    http://www.solidsport.co.uk


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •