Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > script stoped working over christmas ?
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 3rd November 18:20
sat_ring
External User
 
Posts: 1
Default script stoped working over christmas ?



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");
$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;
}
}
}

?>
  Reply With Quote


 


2 4th November 09:56
ceo
External User
 
Posts: 1
Default script stoped working over christmas ?



Dude, put some error checking in there...

if (!$fh) die("Failed to open $filename");

else{
die("file $filename does not exist!");

--
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?
  Reply With Quote
3 4th November 10:01
sat_ring
External User
 
Posts: 1
Default script stoped working over christmas ?


Yes works with full path --- has been working for an age with out ,but then
thats life......

Cheers
Chris
  Reply With Quote
Reply


Thread Tools
Display Modes




666