Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2009, 16:25
ajgj2008
 
Fecha de Ingreso: febrero-2009
Mensajes: 7
Antigüedad: 16 años
Puntos: 0
Errores en avscript web de juegos

Hola todos, estoy montando una web de juegos y ya he dado con el script lo que pasa es que tiene unos errores, yo no se de programacion php soy principiante y me gustaria que me ayudaseis por que tengo los siguientes problemas.


Warning: fopen(online.txt) [function.fopen]: failed to open stream: Permission denied in /home/a5566715/public_html/modules/online_now.php on line 15


Warning: fwrite(): supplied argument is not a valid stream resource in /home/a5566715/public_html/modules/online_now.php on line 19


Warning: fclose(): supplied argument is not a valid stream resource in /home/a5566715/public_html/modules/online_now.php on line 21


Warning: file(online.txt) [function.file]: failed to open stream: No such file or directory in /home/a5566715/public_html/modules/online_now.php on line 25


Warning: Invalid argument supplied for foreach() in /home/a5566715/public_html/modules/online_now.php on line 29


Aquí teneis el archivo online_now.php
Código PHP:
<?

function online_now(){

$remote $_SERVER["REMOTE_ADDR"];

$file "online.txt";

$timeoutseconds 60;

$timestamp time();

$timeout = ($timestamp-$timeoutseconds);

$fp fopen("$file""a+");

$write $remote."||".$timestamp."\n";

fwrite($fp$write);

fclose($fp);

$online_array = array();

$file_array file($file);



foreach(
$file_array as $newdata){

list(
$ip$time) = explode("||"$newdata);

if(
$time >= $timeout){

 
array_push($online_array$ip);

}

}



$online_array array_unique($online_array);

$online count($online_array);



if(
$online == "1"){

echo 
"<p><b>Total users online:</b> $online</p>";

}else{

echo 
"<p><b>Total users online:</b> $online</p>";

}

}

online_now();

?>