holzbrot
New member
Warning: fopen("access.txt","w") - Permission denied in /usr/local/httpd/htdocs/kunden/z57g/html/icq/index.php on line 29
Warning: Supplied argument is not a valid File-Handle resource in /usr/local/httpd/htdocs/kunden/z57g/html/icq/index.php on line 31
Warning: Supplied argument is not a valid File-Handle resource in /usr/local/httpd/htdocs/kunden/z57g/html/icq/index.php on line 32
1
----------------------------------------
<html>
<?php
function tcounter()
{
$counterFile = "access.txt";
if(file_exists($counterFile))
{
$fp = fopen($counterFile, "r+");
$count = fgets($fp,6);
$count++;
rewind($fp);
fputs($fp,$count,6);
fclose($fp);
}
else
{
$fp = fopen($counterFile, "w");
$count = "1";
fputs($fp,$count,6);
fclose($fp);
}
return $count;
}
?>
<body>
Hits: <? echo tcounter(); ?><br>
</body>
</html>
-------------------------------------------------------------
wieso zum Henker geht das nicht? "r+" sollte doch lesen u. schreiben, bzw. "w" nur zum schreiben(u. file anlegen) sein.
wiesooooo....?

Warning: Supplied argument is not a valid File-Handle resource in /usr/local/httpd/htdocs/kunden/z57g/html/icq/index.php on line 31
Warning: Supplied argument is not a valid File-Handle resource in /usr/local/httpd/htdocs/kunden/z57g/html/icq/index.php on line 32
1
----------------------------------------
<html>
<?php
function tcounter()
{
$counterFile = "access.txt";
if(file_exists($counterFile))
{
$fp = fopen($counterFile, "r+");
$count = fgets($fp,6);
$count++;
rewind($fp);
fputs($fp,$count,6);
fclose($fp);
}
else
{
$fp = fopen($counterFile, "w");
$count = "1";
fputs($fp,$count,6);
fclose($fp);
}
return $count;
}
?>
<body>
Hits: <? echo tcounter(); ?><br>
</body>
</html>
-------------------------------------------------------------
wieso zum Henker geht das nicht? "r+" sollte doch lesen u. schreiben, bzw. "w" nur zum schreiben(u. file anlegen) sein.
wiesooooo....?