split in to multiple pages (I think)
| From: | Joker7 | Date: | Sat, 15 Sep 2007 13:16:23 +0000 |
| Subject: | split in to multiple pages (I think) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-262134@lists.php.net to get a copy of this message | ||
Hi,
I'm using the code below to display news articles-which works great apart
from. I can control the number of articles,but I would like to add a link to
the bottom of the page to the un-displayed articles ( nexted 5 articles and
so on) any pointers would be most welcome as most know my PHP skills are not
the best :).
Cheers
Chris
<?
$max_latest = 5;
$filename = "articlesum.php";
#- open article
if(file_exists($filename)){
$fh = fopen($filename, "r");
$old_news = fread($fh, filesize($filename));
fclose($fh);
}
#- get article
$articles = explode("<!--ARTICLE-->", $old_news);
$i=0;
foreach ( $articles as $article ){
if(count($articles)>$i){
if($max_latest >= $i++){
print $article;
}
}
}
?>
--
Cheap As Chips Broadband http://yeah.kick-butt.co.uk
Superb hosting & domain name deals http://host.kick-butt.co.uk