Ir ao conteúdo

Contador So Por Ip, Como Tirar ?


FabianoMAguilar

Posts recomendados

Postado

este contador abaixo ele so conta se for visitado com novo ip, se a pessoa clica no link 2 vez com mesmo ip ele so conta 1 vez, como retirrar deixando ele contar toda vez que for clicado?

<?php

extract($HTTP_GET_VARS);

extract($HTTP_POST_VARS);

$nilc=explode(".",basename($url));

if($url!=""){

$filename=strtolower($url);

$filename= str_replace ("http://","", $filename);

$filename= str_replace ("/","", $filename);

$filename= str_replace ('.',"", $filename);

$filename= str_replace ('?',"", $filename);

$filename= str_replace ('=',"", $filename);

$filename= str_replace (';',"", $filename);

}

$day =date("d");

$month =date("M");

$year =date("Y");

$dt="$day-$month-$year";

$ip = getenv(REMOTE_ADDR);

if(file_exists("data_d/".$filename)) {

}else{

$fr=fopen("data_d/".$filename, "w");

fputs($fr, "0|0|0|0|$dt");

fclose($fr);

}

if($url!=""){

$comp=fopen("data_d/".$filename, "r");

$old_stats=file("data_d/".$filename);

$stat=explode("|", $old_stats[0]);

fclose($comp);

if($stat[3]!=$ip){

$comp1=fopen("data_d/".$filename, "w");

$old_stats1=file("data_d/".$filename);

$stat1=explode("|", $old_stats[0]);

$new_stats= $stat1[0]+1;

fputs($comp1, "$new_stats|$url|$nilc[0].$nilc[1]|$ip|$stat1[4]");

fclose($comp1);

header("Location:$url");

exit;

}else{

$comp1=fopen("data_d/".$filename, "w");

$old_stats1=file("data_d/".$filename);

$stat1=explode("|", $old_stats[0]);

$new_stats= $stat1[0];

fputs($comp1, "$new_stats|$url|$nilc[0].$nilc[1]|$ip|$stat1[4]");

fclose($comp1);

header("Location:$url");

exit;

}

}

if($action=="show_stats"){

echo "<style>TD { FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Verdana }</style>";

echo "<FONT SIZE=3 COLOR=#FF9966 face=arial><CENTER>Unique Links Counter</CENTER></FONT>

";

$handle = @opendir("data_d");

echo "<table cellspacing=0 align=center border=1 bordercolor=#FF9966 ><td align=center>Filename</td><td align=center>URL</td><td align=center>Count</td><td>Counting since</td>";

while (false !== ($file = readdir($handle))) {

if ($file != "." && $file != ".." ) {

$fn=fopen("data_d/".$file,"r");

$statis=file("data_d/".$file);

$stat=explode("|", $statis[0]);

fclose($fn);

if($stat[2] != "0"){

echo "<tr><td>$stat[2]</td><td>'"]$stat[1]</td><td align=center>$stat[0]</td><td>$stat[4]</td></tr>";

}

}

}

closedir($handle);

echo "</table><hr color=#FF9966 width=50%>";

echo "<table width=100% align=center><td align=center>Copyright: Cgixp Team</td></table>";

}

if($link!=""){

$linker=strtolower($link);

$linker= str_replace ("http://","", $linker);

$linker= str_replace ("/","", $linker);

$linker= str_replace ('.',"", $linker);

$linker= str_replace ('?',"", $linker);

$linker= str_replace ('=',"", $linker);

$linker= str_replace (';',"", $linker);

if(file_exists("data_d/".$linker)) {

$fn=fopen("data_d/".$linker,"r");

$statis=file("data_d/".$linker);

$stat=explode("|", $statis[0]);

fclose($fn);

if($stat[0]>=2){ $spell="times"; }else{$spell="time";}

echo "Downloaded $stat[0] $spell";

}else{

echo "Not yet downloaded";

}

}

?>

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...

LANÇAMENTO!

eletronica2025-popup.jpg


CLIQUE AQUI E BAIXE AGORA MESMO!