41 users online (0 members and 41 guests)  

Thread: Includes!


  Results 1 to 4 of 4

Related

  1. Question about asp includes    Forum: Search Engine Optimization - SEO - Forum
    Replies: 7
  2. Server-side Includes    Forum: HTML Forum
    Replies: 2
  3. quik question reguarding includes    Forum: PHP Forum
    Replies: 0
  4. Need some advice about includes    Forum: Website Scripts Forum
    Replies: 2
  5. PHP includes    Forum: PHP Forum
    Replies: 19
  1. #1
    GS16's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2006
    Posts
    6

    Includes!

    hello there,
    Sorry if i am being silly here, but can anyone tell me if i can use includes when coding in html.
    i seem to be able to see my includes when using .asp
    but they dissapear when i use html
    This is cool site
    my name is Rich by the way - hello to you all

  2. #2
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Includes!

    As far as I know you can't use includes in pure HTML.
    When the asp generates the web page, what the browser sees is the final, processed pure HTML - all includes and calculations are finished before it gets to the browser.

  3. #3
    GS16's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2006
    Posts
    6

    Re: Includes!

    Cheers DM,
    I thought that maybe the case.
    I need to try and find some way of updating the same aspect of many pages with just one change - why includes are great.
    I know that this can be done using templates, but i am not too fond of the code that gets dragged in with them.
    i suppose i am trying to find a way of bringing an external html file into a page so that i can all be seen for SEO reasons without it being surrounded by code that is going to get in the way.
    thanks for your help bud
    Rich

  4. #4
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Includes!

    Don't know about asp, but if you have a file for
    HTML Code:
    <doctype ...>
    <html>
    <head>
    ... Meta tags ...
    <link rel ... css file>
    and you use:
    PHP Code:
    <?php
    include_once("file_from_above");
    echo 
    "<title>$title</title>\n</head>\n";
    ?>
    then you'll end up with
    HTML Code:
    <doctype ...>
    <html>
    <head>
    ... Meta tags ...
    <link rel ... css file>
    <title>Page Title</title>
    </head>
    Then any changes you make to the first file will be reflected in any page that includes it, so you could change your css file in all pages at once, or your META tags etc.



Tags for this Thread