Whats my best option...

Discussion in 'HTML & Website Design' started by Cbrackett, Oct 16, 2008.

  1. #1
    I am creating a large HTML website (many page)... I want to design it so that if i have to make a change to the header or the side menu I can change them in 1 file and it will change over all of the pages... Whats the easiest way to achieve this?
     
    Cbrackett, Oct 16, 2008 IP
  2. Setimerenptah

    Setimerenptah Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use PHP, the php file will reference seperate html files so you can have one for your header, one for your links menu etc. Then when you update the header file it will update on each page.
     
    Setimerenptah, Oct 16, 2008 IP
  3. Cbrackett

    Cbrackett Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Where can I go to view and learn how to use this code?
     
    Cbrackett, Oct 16, 2008 IP
  4. hkarakis

    hkarakis Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    you should use the include function to do this. look here
     
    hkarakis, Oct 16, 2008 IP
  5. Cbrackett

    Cbrackett Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    So do I just write the include file in html then save it as a PHP?
     
    Cbrackett, Oct 16, 2008 IP
  6. hkarakis

    hkarakis Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #6
    create a php file write your header on it. then include the your header file all of your pages. so with this function if you change your header file all off your pages header will change
     
    hkarakis, Oct 16, 2008 IP
  7. pachecus

    pachecus Well-Known Member

    Messages:
    1,841
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    110
    #7
    You should use a script to make easier the job of changing anything on your website, try to learn php or find someone who can code a script for you.
     
    pachecus, Oct 16, 2008 IP
  8. Cbrackett

    Cbrackett Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    alright thanks guys!
     
    Cbrackett, Oct 16, 2008 IP
  9. Cbrackett

    Cbrackett Peon

    Messages:
    93
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Can i call a HTML file if i want to or does it HAVE to be a php file?
     
    Cbrackett, Oct 16, 2008 IP
  10. scoopy82

    scoopy82 Active Member

    Messages:
    838
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    70
    #10
    Yes you can include HTML files... but the page using <?php include ("my.html"); ?> needs to use the ".php" extension... but that file can also be just HTML... just renamed with ".php".

    I did a simple post explaining how to use php include here:
    http://www.scoopy.us/odds-n-ends/save-time-with-php-include
     
    scoopy82, Oct 16, 2008 IP