update 1 page rather then whole site

Discussion in 'HTML & Website Design' started by druzilla, Aug 22, 2006.

  1. #1
    hey,

    is there a way where i update 1 html page have that code appear in a table on all my pages.

    example: i have a menu on all my pages, when i want to add another option i want to chnge 1 page and have them all update.

    does that make sense?

    would i do it with php?
     
    druzilla, Aug 22, 2006 IP
  2. cellularnews

    cellularnews Peon

    Messages:
    246
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use the includes directive in php to include a seperate html/text file into the page you are outputting.

    More often known as SSI (server side includes).
     
    cellularnews, Aug 22, 2006 IP
  3. druzilla

    druzilla Guest

    Messages:
    176
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hey whats the code for that?

    cheers,
     
    druzilla, Aug 22, 2006 IP
  4. hillord

    hillord Well-Known Member

    Messages:
    2,211
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    140
    #4
    use php. i can help you at a minimal charge if you're willing?
     
    hillord, Aug 22, 2006 IP
  5. druzilla

    druzilla Guest

    Messages:
    176
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    nah thanks,

    il wait for somebody more generous or search a bit more on the net.
    thanks anyway
     
    druzilla, Aug 22, 2006 IP
  6. ih82lose

    ih82lose Active Member

    Messages:
    377
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Hello,

    I am no PHP expert, but I have a few sites that use includes for the reson you need them. Basicly you need to take your current HTML file and turn them into .inc files. You will need .inc files for each part of your site (ie. top navigation, side bar, main body etc.). The inc files will be the HTML, and you will be able to change the ones common on your site globally.

    The include command:
    <? include("filename.inc") ?>

    Some resources:
    http://www.hardcoder.com/scripting/php/include_files.php
    http://www.php.net/include/
    http://www.developerfusion.co.uk/show/1826/
     
    ih82lose, Aug 22, 2006 IP
  7. druzilla

    druzilla Guest

    Messages:
    176
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    ah thats awesome.. easier then then what i was going to use..

    appreciate the help ih82lose
     
    druzilla, Aug 22, 2006 IP
  8. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It should be noted that include is not a function, so it doesn't need paranthesis. It's also a good practice to open php with <?php rather than just <?. And most people don't use .inc in the web accessible directories because the contents can be read by anyone (instead, keep it inaccessible, or rename it with a .php extension and adjust the code/source accordingly). By default, .php files are output as html, so you can have a regular html file with no php and call it blah.php without a problem (including files to be included).
     
    Gordaen, Aug 22, 2006 IP
  9. ItoNakamura

    ItoNakamura Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hi..ih82lose , Gordaen & all guys

    Greetings guys... may i know if my site use FLASH or swif in my main index page; can i also use the .inc files also?? Thanks in advance...
    :)
     
    ItoNakamura, Aug 23, 2006 IP
  10. ih82lose

    ih82lose Active Member

    Messages:
    377
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    60
    #10
    Yes, flash will work fine in include files.
     
    ih82lose, Aug 24, 2006 IP