$number-1){
$num=0;
}
// write the current number to the file
if (file_exists($directory.$adcountfile)) {
$nu = fopen ($directory.$adcountfile, "w");
fputs($nu,$num);
}
else {
die("
Can't find file
Check ad-count file ($adcountfile) exists
Check file with links ($linkfile) exists
Check directory ($directory) is correct");
}
// display the link on the page
if($help_msg == "yes"){
echo "{$pos_statag}
$help_message{$pos_endtag}";
}
echo "
$adverts[$num]
";
?>