Here's a function to print 'unexpired' content...
function PrintCurrentArticles($HowMany) {
$HowMany++;
for($n=1; $n<$HowMany; $n++) {
$File=("/www/articles/article"."$n".".txt");
$Open=fopen($File, "r");
if ($Open) {
$Content = fread($Open, 1000);
$ExpireDate=substr($Content, -17, -2);
$ExpireSeconds=strtotime($ExpireDate);
$Now = time();
if ($Now > $ExpireSeconds) { $n++;
fclose($Open); }
else { echo $Content;
echo "<br><br>";
fclose($Open);
$Content=""; }
} # end of 'if open'
else {echo '<br><br>Unable to include $File at present.<br><br>'; }
} # end loop --- for
} #end function
...which works on one box and not another. I can't find
any reason why....
working box: apache 1.3.27/mod_php4.2.3
non-working box: apache 1.3.26/php 4.1.1
I'm upgrading the older box today, mostly to get this working,
(but why tempt the haxorz, anyhow?) but I'm wondering if it's
gonna help with this issue....
Anyone see anything version-specific about this code?
TIA,
Dalecosp
Hmmmm.... me wonder why I used $n in TWO places...