Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking page content within a div or table cell

Status
Not open for further replies.

Artifice

Technical User
Mar 18, 2003
22
GB
I run a Sidebar on my website. What I would like to do is the following:

Because the Sidebar changes regularly and appears on multiple pages, I don't want to have to manually change the Sidebar every time there is a change.

Is it possible to have the html code for the Sidebar content on a separate page that I name sidebar.html and then I call that html code to appear in a designated table cell or div on all of my main content pages?

I am guessing this is possible but am not sure of the best way to handle this. My pages at the moment are all .html. Is there a way to do this without having to change every page to .php? Ideally I would like to keep this as simple as possible because while I have a working knowledge of coding it is not my greatest skill.

Any help would be appreciated.

Mark
 
It is doable in many different way however plain HTML is not one of them. Ways to do it Include not only PHP, but also ASP, SSI's and various other techniques.

Obviously we would need to know what is available to you to recommend a possible course.

If you don't want to change your pages, well change their extension actually, to anything at all SSI's may be the best option but you need to make sure the server where your pages are hosted supports this.

Using PHP or ASP is just a matter of changing the page extension to php or asp, and adding in the relevant code. The rest of your html does not need to be changed. Additionally the relevant code could be as simple as:

include("sidebar.html");
at least in PHP.

Can you tell us what your web host supports so we can point you in the right direction?

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top