I need both a vertical and horizontal news ticker that can pull the news from a database. I have found a good script that pulls the news from an xml file from http://www.objectplanet.com/NewsTicker/ However want to know if it would be possible to do something similar using a database.

    I don't know where to start. please can you point me in the right direction.

      Basically you will either need to write some Javascript which can move a <div> or <span> HTML element dynamically. Or use the <marquee> tag :p

      Then write a PHP file which extracts the latest news from a database, and then writes, lets say, a Javascript array into a page, which your Javascript function above can read and add to the <div> or <span>.

      Not all that hard really 🙂

      The link you have in your post is for a Java applet. Applets are a bit more useful in that they can have a 'live' link to a news feed somewhere, whereas a PHP version will be, in a sense, statcic as the news content wouldn't update until the page was refreshed.

        like it says on the site all u have to do is echo the news out in the follo format

        <news>
        <header>
        news header text
        </header>
        <body>
        This is the text of the news item
        body. It can contain as much text
        as you want. The item in the link
        tag is the url opened when the
        more... link is selected by the user.
        </body>
        <link>
        newsitem.html
        </link>
        </news>

        so get the news from your db and while ure looping through the resultset echo it out in that format.

        reg
        kevin

          As soon as I turn the news page into a php page the code stops working.

            Write a Reply...