Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/09/2007, 19:34
Avatar de manumaf
manumaf
 
Fecha de Ingreso: mayo-2007
Ubicación: Argentina
Mensajes: 854
Antigüedad: 17 años
Puntos: 6
Que hay de malo en este codigo?

Miren este codigo es para contar las visitas de mi web
Código PHP:
<?php


$counterFile
="contonline/visitas.txt";

function 
displayCounter($counterFile) {
$fp fopen($counterFile,rw);
$num fgets($fp,5);
$num += 1;
print 
"$num";
exec"rm -rf $counterFile");
exec"echo $num > $counterFile");
}
if (!
file_exists($counterFile)) {
exec"echo 1 > $counterFile");
}
displayCounter($counterFile);

?>
El problema es que en mi web aparece lo siguiente
Hay 1 usuario en línea.

Warning: fopen() [function.fopen]: Unable to access contonline/visitas.txt in /home/manumaf/domains/libertinaje-habbo.net/public_html/index.php on line 275

Warning: fopen(contonline/visitas.txt) [function.fopen]: failed to open stream: No such file or directory in /home/manumaf/domains/libertinaje-habbo.net/public_html/index.php on line 275

Warning: fgets(): supplied argument is not a valid stream resource in /home/manumaf/domains/libertinaje-habbo.net/public_html/index.php on line 276
1