Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP includes…

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26200
    Mr Dobalino
    Member

    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

    #64525
    TheDoc
    Member

    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)

    #64526
    Mr Dobalino
    Member

    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

    #64527
    Makeshift
    Member

    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..

    #64529
    TheDoc
    Member

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

    #64530
    Mr Dobalino
    Member

    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?

    #64547
    TheDoc
    Member

    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.

    #64549
    Rob MacKay
    Participant

    Mr TheDoc is right.

    and yes includes are awesome :)

    #64759

    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)
  • The forum ‘Back End’ is closed to new topics and replies.