Compteur php
jérémy1664
Messages postés
165
Statut
Membre
-
jérémy1664 Messages postés 165 Statut Membre -
jérémy1664 Messages postés 165 Statut Membre -
Bonjour,
J'ai un problème avec mon compteur php
Il marche avec les adresses ip,
il y a un fichier ip.txt qui s'incrémente que quand il est vide alors qu'il devrait le faire à chaque fois qu'une nouvelle ip entre sur mon site
Conclusion le compteur est faux et reste bloqué
Il fonctionne aussi avec un fichier compteur.txt
Si quelqu'un a un solution ?
J'ai un problème avec mon compteur php
Il marche avec les adresses ip,
il y a un fichier ip.txt qui s'incrémente que quand il est vide alors qu'il devrait le faire à chaque fois qu'une nouvelle ip entre sur mon site
Conclusion le compteur est faux et reste bloqué
Il fonctionne aussi avec un fichier compteur.txt
<?
$numip = "10";
$anzdir="modules\compteur.txt" ;
$ipdir ="modules\ip.txt" ;
//$anzdir="D:\vhosts\gs-computer.eu\httpdocs\compteur.txt" ;
//$ipdir ="D:\vhosts\gs-computer.eu\httpdocs\ip.txt" ;
if (file_exists($anzdir) AND file_exists($ipdir))
{
global $REMOTE_ADDR, $ipdata, $userip1;
$userip = $_SERVER["REMOTE_ADDR"];
$ipfile = fopen($ipdir,"r+");
$ipfile1 = fgets($ipfile,200);
$ipdata = explode(":",$ipfile1);
fclose($ipfile);
if (in_array($userip, $ipdata))
{
global $nummer,$anzahl;
$anzahl = fopen("$anzdir", "r+") ;
$nummer = fgets($anzahl,9);
fclose($anzahl);
}
else
{
global $num, $userip;
$num = count($ipdata);
if ($num <= $numip)
{
$ipfile1 = substr($ipfile1,0,strlen($ipfile1)-1);
$ipfile1 = $ipfile1.$userip.":";
$ipfile = fopen($ipdir,"w+");
fwrite($ipfile, $ipfile1);
fclose($ipfile);
$anzahl = fopen("$anzdir", "r+");
$nummer = fgets( $anzahl, 9 );
$nummer++;
fseek($anzahl, 0);
fputs( $anzahl, $nummer );
fclose($anzahl);
}
else
{
global $ipdata9, $push;
$pop = array_pop($ipdata);
$ipdata = array_reverse($ipdata);
array_push($ipdata,$userip);
$ipdata = array_reverse($ipdata);
$userip2 = implode(":",$ipdata);
$ipfile = fopen($ipdir,"w+");
fputs($ipfile,$userip2);
fclose($ipfile);
$anzahl = fopen("$anzdir", "r+");
$nummer = fgets( $anzahl, 9 );
$nummer++;
fseek($anzahl, 0);
fputs( $anzahl, $nummer );
fclose($anzahl);
}
}
}
else
{
if (file_exists($ipdir))
{
global $nummer;
$fo = fopen($anzdir,"w+");
fputs($fo, 1);
$nummer = 1;
}
else
{
global $nummer;
$foip = fopen($ipdir, "w+");
fputs($foip, $REMOTE_ADDR.":");
fclose($foip);
$foan = fopen($anzdir,"w+");
fputs($foan, 1);
$nummer = 1;
}
}
//echo <span class="compteur"><b>.$nummer.</b></span>;
echo $nummer;
?>
Si quelqu'un a un solution ?
A voir également:
- Compteur php
- Compteur électrique - Guide
- Compteur de contractions - Télécharger - Santé & Bien-être
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Compteur point fléchette excel - Télécharger - Sport