Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/06/2002, 10:58
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años, 1 mes
Puntos: 1284
Re: Saber visitantes que estan conectados (URGENTE)

Hola otra vez: (veo que tunait se me adelantó)

Este código en php sirve como contador:

<?
Function cont () {
$archi = "contador";
if (file_exists($archi)) {
$fich = fopen($archi, "r+");
$cuenta = fgets($fich, 7);
$cuenta ++;
rewind($fich);
fwrite($fich, $cuenta, 7);
fclose($fich);
}
else {
$fich = fopen($archi, "w");
$cuenta = "1";
fwrite($fich, $cuenta, 7);
fclose($fich);
}
return $cuenta;
}
?>

<html>
<head>
<style>
body {margin: 0 0 0 0;

valgn: top;
}
big {color:blue;}
</style>
<title>Contador</title>
</head>
<body >
<center><big ><? echo cont(); ?></big></center>
</body>
</html>

Como mi servidor no admite php, no me preocupo mucho, pero viendo el código, habría que hacer $cuenta -- cuando se van las visitas.

Perdona por no ayudarte mejor, pero no manejo mucho php...

Saludos