Jump to content
Fórum Script Brasil
  • 0

Contador por IP\Valor Inicial


LegendaryzSB
 Share

Question

<?php 

 # Criando um cookie 
 setcookie(); 

 # Dados para conexão 
 $host = "localhost"; 
 $user = "usuario"; 
 $senha= "senha"; 
 $conexao = mysql_connect("$host", "$usuario", "$senha"); 
 $db = mysql_select_db("nome_da_tabela"); 
 $inserir = "INSERT INTO nome_da_tabela (campo_ip) VALUES ('$_SERVER[REMOTE_ADDR]')"; 
 $selecionar = "SELECT campo_ip FROM nome_da_tabela"; 

 # Se o IP for novo será inserido na DB 
 If ($_SERVER["REMOTE_ADDR"] != $_COOKIE["visitante"]) { 
 mysql_query ($inserir, $conexao); 
 $_SERVER["REMOTE_ADDR"] = $_COOKIE["visitante"]; 
 } 
 else { 
 echo "Obrigado por retornar ao nosso site!"; 
 } 

 # Conta visitas de IP únicos 
 $contador = mysql_query ($selecionar, $conexao); 
 $visitantes_unicos = mysql_num_rows($contador); 

 # Exibe visitas de IP únicos 
 echo "<br />Visitantes Únicos: " . $visitantes_unicos . ".<br />" . "O seu IP: " . $_SERVER["REMOTE_ADDR"] . "<br />"; // Mostra o IP 

 ?>

Preciso que o contador começe com o número de '19.500' !

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.1k
×
×
  • Create New...