Re: [PHP] script stoped working over christmas ?
- From: ceo@xxxxxxxxx ("Richard Lynch")
- Date: Sun, 30 Dec 2007 18:59:01 -0600 (CST)
Dude, put some error checking in there...
On Sat, December 29, 2007 5:23 am, Joker7 wrote:
Can anyone see why this has stopped working...
latest.php is used with <?
include("/home/sever2/public_html/teaup/article/article_summary.php")
?> to
show the latest news articles.
Cheers
Chris
config.php
<?php
$max_summary = 6;
$max_latest = 7;
$summary_template = "t_summary.tp";
$article_template = "t_article.tp";
$password = "password";
?>
latest.php
<?php
require('config.php');
$filename = "article_summary.php";
#- open article summaries
if(file_exists($filename)){
$fh = fopen($filename, "r");
if (!$fh) die("Failed to open $filename");
$old_news = fread($fh, filesize($filename));else{
fclose($fh);
}
die("file $filename does not exist!");
#- get article
$articles = explode("<!--ARTICLE-->", $old_news);
$i=0;
foreach ( $articles as $article ){
if(count($articles)>$i){
if($max_latest >= $i++){
print $article;
}
}
}
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
.
- References:
- script stoped working over christmas ?
- From: "Joker7"
- script stoped working over christmas ?
- Prev by Date: Re: [PHP] looping through a $_POST variable
- Next by Date: Re: [PHP] php.ini in php5.2.1
- Previous by thread: Re: script stoped working over christmas ?
- Next by thread: Bcompiler, When I try execulte a compiled code, apache's break
- Index(es):
Relevant Pages
|