Updating Content Across A Site Using One Seprate Page?

Discussion in 'HTML & Website Design' started by skaterkee, Apr 6, 2008.

  1. #1
    Hi, I'm wondering how I would go about updating multiple pages using just one. You see I have a content column that I need to update across the site every few days but don't want to edit tonnes of pages each time.

    I assume there's a way using PHP to put a code in each page that updates automatically when the code's page is updated?

    E.g

    a) php file with changing content
    b) regular page with php code

    when a is updated so is B
     
    skaterkee, Apr 6, 2008 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Using php one time you go through each page manually and add <?php include("update.php" ; ?> where you want the content to appear.

    Then whatever you place in the file update.php will show on all the pages that have the include. Note that if the update file is not in the same directory will need to include the path to the file.
     
    Colbyt, Apr 6, 2008 IP
  3. skaterkee

    skaterkee Well-Known Member

    Messages:
    651
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Great - thanks mate.
     
    skaterkee, Apr 6, 2008 IP
  4. skaterkee

    skaterkee Well-Known Member

    Messages:
    651
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #4
    Just an update for anyone who needs the same information and might read this topic I had to edit

    <?php include("update.php" ; ?>

    to

    <?php include("update.php"); ?>
     
    skaterkee, Apr 6, 2008 IP
  5. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #5

    Nice catch! That was a typo.
     
    Colbyt, Apr 6, 2008 IP