Posted by Dalibor on 02/18/06 02:00
I wrote some code for displaying news on my website.
Code goes like this:
<?
$newsfile = 'news.txt';
echo "<B>TRENUTNE VIJESTI</B><br>\n";
$data = file($newsfile);
$data = array_reverse($data);
echo "<span style=\"normal 11 Verdana; color:#fff; text-align:justify;\">";
foreach($data as $element) {
$element = trim($element);
$pieces = explode("|", $element);
echo $pieces[2] . "<BR>" . "<span style=\"font:normal 11px
Tahoma\"><u>Published</u>: " . $pieces[1] . " " . $pieces[0] .
"</span></span><BR><br>";
}
?>
I have form that puts content in flat file.
Messages are writen in flat file in format like this:
21.Feb 2006.|Dalibor|Some message text
14.Feb 2006.|Dalibor|Other message text...
I need piece of code for displaying last 5 messages and for deleting
certain messages.
Can you help me? Thanks!
--
..:Dalibor:.
Navigation:
[Reply to this message]
|