Log in

View Full Version : Importing txt into a marquee



Philippa
05-20-2008, 07:04 PM
Hi, I really need some help!
First off I have nottraining in any sort of programming and am attempting to teach myself using sites such as this and so far doing an okay job. (thanks) I am designing an intranet for my school and have got a marquee news banner on the first page. Problem is I want other people to update the news without going into the script. I've designed the page in html using divs. Is there any (easy) way of importing text from an external txt file into the news feed?
Hope you can help - Philippa x

Nile
05-21-2008, 11:40 AM
The answer to your question is, No, there is no way easy of doing this. You'll need PHP, and perhaps MySQL.

thetestingsite
05-21-2008, 02:28 PM
Well, you could probably use SSI (server side includes), but I'm not 100% on that.

fileserverdirect
05-22-2008, 01:47 AM
Actually, php is your best bet,


<!--html code here-->
<?php
$handle = fopen("news.txt", "rb");
$contents = stream_get_contents($handle);
fclose($handle);
?>
<!--more html code here-->
<marquee><?php echo $contents; ?></marquee>
<!-- more html code here-->


Now just edit news.txt, and there you go...
P.S. change you filename to index.php
:)