Hey,
ik heb een aantal fouten zitten in het script.
maar kom er niet uit hoe ik dit moet oplossen.
De fouten:
Warning: fopen(cache/online.txt) [function.fopen]: failed to open stream: Permission denied in public_html/includes/ingame.inc.php on line 120
Warning: fputs(): supplied argument is not a valid stream resource in public_html/includes/ingame.inc.php on line 121
Warning: fclose(): supplied argument is not a valid stream resource in /public_html/includes/ingame.inc.php on line 122
Warning: fopen(cache/stat-aantal.txt) [function.fopen]: failed to open stream: Permission denied in public_html/includes/ingame.inc.php on line 136
Warning: fputs(): supplied argument is not a valid stream resource in /public_html/includes/ingame.inc.php on line 137
Warning: fclose(): supplied argument is not a valid stream resource in /public_html/includes/ingame.inc.php on line 138
Warning: fopen(cache/stat-nieuw.txt) [function.fopen]: failed to open stream: Permission denied in /public_html/includes/ingame.inc.php on line 136
Warning: fputs(): supplied argument is not a valid stream resource in /public_html/includes/ingame.inc.php on line 137
Warning: fclose(): supplied argument is not a valid stream resource in /public_html/includes/ingame.inc.php on line 138
Stukje script met de fouten:
//Cache Query in txt
function query_cache($page,$query,$expire){
$file = 'cache/'.$page.'.txt';
if (file_exists($file) &&
filemtime($file) > (time() - $expire)) {
$records = unserialize(file_get_contents($file));
} else {
$result = mysql_query($query) or die (mysql_error());
while ($record = mysql_fetch_assoc($result)) $records[] = $record;
$OUTPUT = serialize($records);
$fp = fopen($file,"w");
fputs($fp, $OUTPUT);
fclose($fp);
} // end else
return $records;
}
function query_cache_num($page,$query,$expire){
$file = 'cache/'.$page.'.txt';
if (file_exists($file) &&
filemtime($file) > (time() - $expire)) {
$record = unserialize(file_get_contents($file));
} else {
$result = mysql_query($query) or die (mysql_error());
$record = mysql_num_rows($result);
$OUTPUT = serialize($record);
$fp = fopen($file,"w");
fputs($fp, $OUTPUT);
fclose($fp);
} // end else
return $record;
}
Toon Meer
hopend kunnen jullie helpen,
met vriendelijke groeten,
Kevin