I have a flatfile system that inserts things into a flatfile like:
[BEGIN]
Someones Text
[END]
Exactly like that.
How can I make it so it shows me at the top of the page the most eneterd text (top 5)
Thanks
Printable View
I have a flatfile system that inserts things into a flatfile like:
[BEGIN]
Someones Text
[END]
Exactly like that.
How can I make it so it shows me at the top of the page the most eneterd text (top 5)
Thanks
I think this is what you mean...
Thats an example for runescape news.. s = start lineCode:<?php
$line=file("http://www.runescape.com/title.ws");
$snum=0;
$enum=0;
$s = 'www.runescape.com/img/title2/recent_news.gif" alt="Recent News"></dt>';
$e = '<img class="narrowscroll-bottom" src="http://www.runescape.com/img/scroll/scroll457_bottom.gif" alt="" width="466" height="50">';
for($i=0;$i<count($line);$i++) {
if(strstr($line[$i],$s)) {$snum=$i;}
if(strstr($line[$i],$e)) {$enum=$i;}
}
for($i=$snum;$i<$enum;$i++) {
echo $line[$i];
}
?>
e = end line
simple and just change the url at the top :)
Doesn't work.
whats the page you want to use and what part of it do u want?
Cant show the page. Basically people are entering text like "Orange & Green" and it sends to a flatfile page where it is set out like:
[BEGIN TEXT]
John voted for Orange & Green
[END TEXT]
I want to display at the top of the page like:
The top 5 votes are
1. Orange & Green
2. Pink & Blue
etcetc
Can't you use MySQL?
twas what i was thinking, i dont have much exprence with flatfiles i know that you have to split each entry up with | OR something so they can be split with the php
MySQL would just be much easier :P