Grow your CSS skills. Land your dream job.

PHP includes…

  • # September 21, 2009 at 6:48 pm

    Hi,

    Are there disadvantages to using php includes when building web sites in general?

    I have recently come across the idea and wanted to know if I should be using them on every site that I build and why (or why not). I know they make it easier to maintain etc but is there a reason why I shouldn’t be doing it and if there aren’t good reasons, why isn’t everyone doing it?

    cheers

    # September 21, 2009 at 6:58 pm

    You shouldn’t really be using them for content, but things things like including a header, navigation, or footer it is perfectly acceptable.

    (also moved this to the PHP section)

    # September 21, 2009 at 7:32 pm

    and would you say there are any downsides to it as opposed to pure HTML and CSS?

    I suppose you can only do testing on the server.

    Should I be using it for all of my future website projects regardless of size or is it purely personal preference?

    cheers

    # September 21, 2009 at 8:04 pm

    The only dis-advantages I can think of is linking wrong in the included file if it is another folder..

    I do believe it is personal preference.. It’s great for headers, footers, and menus..

    # September 21, 2009 at 9:06 pm

    I can’t think of any downsides to be honest.

    # September 21, 2009 at 9:24 pm

    OK great,

    in regards to headers though, it can be detrimental to the SEO in regards to the varying description and title tags from page to page right?

    # September 22, 2009 at 1:51 am

    The meta tags are relatively meaningless. Shouldn’t differ from page to page. What’ll be really important is the content on those pages. I can’t stress that enough.

    Rob
    # September 22, 2009 at 4:47 am

    Mr TheDoc is right.

    and yes includes are awesome :)

    # September 27, 2009 at 12:17 pm

    By the way, although includes are great and there are few downsides to them I would suggest using require() because then if the content isn’t available the rest of the site won’t load. This is good if you don’t want your navigation replaced with a load of text generated as an error message.

    Otherwise includes are great!

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".