1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP A News thread for all pages...

Discussion in 'Web Development' started by mcironlung, Jul 29, 2007.

  1. mcironlung

    mcironlung New Member

    Update: I think I posted this in the wrong section earlier. Also, I have been looking into the introduce thing with php? I didnt know if someone had a great link that helps you set it up. I assume you need something with MySQL? Thanks again.

    Okay, I am new to the .css area, but I have modded a site from a template on here with it. However, I am wanting to add a "latest news" section on the left side of my page similar to the one in architecture2.

    Here is the deal I am runnign into. In the .html file the "news" article looks like this:

    <div id="news">
    <h2>Latest News</h2>
    <h3>02/03/07</h3> <p>If you're looking for beautiful and professionally made templates you can find them at <a href="http://www.templatebeauty.com">Template Beauty</a>.</p>
    <p class="more"><a href="http://www.freewebsitetemplates.com">more</a></p>
    <div class="hr-dots"> </div>

    Now the deal with this is, If I wanted to keep that news article so all links/future .html pages would see it on the left side then I would technically have to go into each page (weither it be 2 or 20) and copy and paste the new code in that section, then re-upload all pages to my hosting service, correct? I am thinking there has to be a better way to do this. Like a way to update the section once and all pages then "grab" the text from a file or something and display it?

    If anyone knows how to do this or can offer a better way to update news articles (that are displayed on all pages within a website) it would help alot. Thanks a ton.
     
  2. kalnera

    kalnera New Member

    Try this

    where you want to add the text or links add this code to html page

    <script language="JavaScript" src="http://www.yourwebsite.com/file.js"></script>

    than create java file named file.js with following text in it

    document.write('the code or text you want to appear on each page');

    of course, file does not have to be named file.js. It can have any name you want it to have as long as it is reflected in the code you place on the html page.

    I hope this helps :)