Re: [PHP] script stoped working over christmas ?



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));
fclose($fh);
}
else{
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?
.



Relevant Pages

  • does die() allow PHP to be sent to the browser screen?
    ... I'm shocked to see that on a page that failed, all the PHP that came ... after a die() statement got sent to the screen, ... Serious misconfiguration, dude. ... Spelling is case senstive. ...
    (comp.lang.php)
  • Re: I need how to on web form timer in vb.net...
    ... Dude, this is a flash program doing this, not .NET, not PHP, not even ... JavaScript (which is the other programatic way to do this... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Any ideas?
    ... <?php require_once; ?> ... > Dude, can't get the page to load. ...
    (alt.php)
  • Re: [PHP] build a multi chat server with php
    ... On Sat, December 8, 2007 2:59 am, abderrazzak nejeoui wrote: ... You MIGHT want to consider taking a well-supported MUD or whatever, ... and using its API to make an extension to PHP. ... Yeah, I get a buck. ...
    (php.general)
  • Re: evaluate code before serving it
    ... contains HTML and now and then some embedded PHP snippets. ... Serving those news articles on the Web works fine, ... Depends on how you generator script works offcourse... ... if the RSS generator gets urls, just give him the exact url of the file holding the article. ...
    (comp.lang.php)