Static information accross pages

liunx

Guest
Hey guys,<br /><br />youve all been loads of help allready, which is much appreciated. Here's another target="_blank">http://www.medinasport.co.uk/medinasport/ I want to be able to have the 2 side sections (i.e latest news and links) static accross all pages so that if they are edited in style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--content-->
Cut out the info you want to "include" and save it as a separate file. So, for example, create a new file called "latestnews.html" and put this info in it (you can just do this in Notepad, but make sure you're saving it as "all files" and include .html at the end; otherwise, it will save as latestnews.html.txt):<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><div class="announce"><br /><h2>Latest News</h2><br /><p><strong>21/22 Sept 2007 - Oulton Park</strong><br /><br />  James cole made it four wins in a row and now leads the overall North West   Formula Ford Championship</p><br /><br /><p class="textright"><a href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"news/Oulton2122.html">Read more...</a></p><br /><p><strong>18/19 Aug 2007 - Anglesey international circuit</strong><br /><br />Medina Sport takes the spoils at Anglesey international circuit</p><br /><p class="textright"><a href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"news/Anglesey1819.html">Read more...</a></p><br /><br /><p><strong>18/19 Aug 2007 - Best Birthday Present for Medina   Drivers:</strong><br /><br />  Medina Sport Drivers James Cole and Gary Jones both share the same birthday and   it brought them both good luck at Oulton Park on Saturday</p><br /><p class="textright"><a href=http://www.webdesignerforum.co.uk/lofiversion/index.php/"news/Oulton1819Aug.html">Read more...</a></p><br /></div><!--c2--></div><!--ec2--><br /><br />Do not put any of the normal HTML doc info on this page (header, etc). JUST THIS COPY.<br /><br />Then, in your index file, replace all of the above information (everything between the divs) with what <b>php_penguin</b> said:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php include("latestnews.html"); ?><!--c2--></div><!--ec2--><br /><br />Finally, "Save as" your index file as "index.php" (again, you can do this in Notepad but make sure the extensions are correct). Upload both files (index.php and latestnews.html) and your side menu should be included in the index file. You will need to delete the old index.html file from your web server.<br /><br />Also, you may want to change your "annouce" div class to div id, and make sure all layout/structural markup is in your stylesheet and not on the actual page. This will make the transition run smoother.<!--content-->
thanks for that.<br />I've got a feeling the place where that is hosted doesnt support PHP. (not a host of my choosing 123-reg.co.uk). Is it worth just either<br /><br />1) routing that page to some of my space that does support PHP<br />2) finding another way to do it (ie the javascript example) or<br />3) Getting a new hosting package for that site.<br /><br />Cheers again for the help.<br /><br />Crammy<br /><!--content-->
anyone got any examples of using the JQuery method of doing thigs?<br /><br />Cheers for the help with the PHP, but as able i have got it to work on one of my hosting packages however the one where this site is hosted, PHP is not supported.<br /><br />Cheers<br />Crammy<!--content-->
using the jQuery method is a last resort, as about 3 in 50 of your users won't see anything... Getting a new host would be the best option, or forcing your existing one to install PHP - if you are paying for it, it shouldn't be a problem.<!--content-->
 
Back
Top