Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Sep 2005
    Posts
    48
    Member #
    11500
    Hi there.
    I currently have a problem regarding server side includes.
    My site is purely html, and at the top of these html pages there is a large chunk of code that is the same on every page. If i change something in that code it means having to change every single html page which is very tedious. I heard about SSI and wondered whether i could put some text (the code that is the same on all the pages) in a file, and just change that file if i change it. Then all of the pages will have changed after making just the one change!!
    If anyone could point me in the right direction for this and tell me if this is the right thing, i would be extremely grateful!!!
    Thank you
    Craig

  2.  

  3. #2
    Senior Member GeZe's Avatar
    Join Date
    Dec 2003
    Posts
    330
    Member #
    4381
    PHP can do this, with include statements. First, you need to see if PHP is installed on your host, if it is then do the following.


    1. Take the code that you want to be reapeted and copy and past it in a file named "header.php"
    2. Remove the code from all your other pages,then add
      PHP Code:
      <?php include ('/add/directory/names/here/header.php'); ?>
      to the top of the page, removing the "/add/directory/names/here/" and adding your actual directory names.
    3. Rename all the files so they end in .PHP not .HTML.
    4. Yay! Thats it, I don't think I've missed anything. If I have someone please post.
    -GeZe

  4. #3
    Member
    Join Date
    Sep 2005
    Posts
    48
    Member #
    11500
    thank you so much for the quick reply!!!
    ive never used php, but i know its installed on the server and those instructions are foolproof, i will let you know tomorrow whether its worked or not, i cant upload my files on this pc.
    Anyway, thank you again!
    Craig

  5. #4
    Senior Member GeZe's Avatar
    Join Date
    Dec 2003
    Posts
    330
    Member #
    4381
    oh, and all the links you have need to be changed in your navagation and other places from "home.html" etc. to "home.php" etc. You can do this qiuckly with the "find and replace" funtion in most editors
    .
    -GeZe


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:34 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com