← Desenvolvimento

Mostra e regista IP

Lida 2381 vezes

Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Alguem sabe dum scritp simples que mostre e guarde o ip com a data e hora da visita num file .txt ou bd?

cumps
Offline

Bruno Mota 
Membro
Mensagens 1733 Gostos 3
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

eu ja posto o script
Offline

Bruno Mota 
Membro
Mensagens 1733 Gostos 3
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Orá bem aqui fica o script
http://brunomota.info/guardaip.rar
onde quiserem guardar o ip basta colocar
<? include 'guardaip.php';?>
para depois verem os ips guardados é so oseudominio.tld/verip.php
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

Tks bruno  :D
Offline

-RJ- 
Membro
Mensagens 1188 Gostos 0
Troféus totais: 30
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Level 5 Level 4 Level 3

penso k o k keres talvez seja uma coisa simples destas:

Código: [Seleccione]
<?php
$hostname 
gethostbyname&#40;$_SERVER['REMOTE_ADDR'&#93;&#41;;
 
echo $hostname;

//Hora
$hora date&#40;"H&#58;i&#58;s"&#41;;

//Data
$data date&#40;"j/m/y"&#41;;

//Abre o ficheiro ip.txt
$fp fopen&#40;"ip.txt", "a"&#41;;

//Escreve no ficheiro aberto o IP a data e a hora de entrada
fputs &#40;$fp, "IP&#58; $hostname - Data&#58; $data - Hora&#58; $hora \r\n"&#41;;

//Fecha o ficheiro
fclose&#40;$fp&#41;;
?>


:)
Offline

Bruno Mota 
Membro
Mensagens 1733 Gostos 3
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

-RJ-, sim é mais simples mas eu perfiro usar MySQL
Offline

=IceBurn= 
Membro
Mensagens 897 Gostos 3
Feedback +3

Troféus totais: 32
Trófeus: (Ver todos)
Windows User Level 6 Linux User Mobile User Super Combination Combination Topic Starter Poll Voter Poll Starter Level 5

Citação de: "asturmas"
Alguem sabe dum scritp simples que mostre e guarde o ip com a data e hora da visita num file .txt ou bd?

cumps


http://forum.maistrafego.pt/index.php?topic=3318#3324 :mrgreen:
Offline

asturmas 
Administrador
Mensagens 19734 Gostos 50
Feedback +2

Troféus totais: 39
Trófeus: (Ver todos)
Mobile User Windows User Super Combination Combination Topic Starter 100 Poll Votes 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter

tambem gostei  :D
Offline

=IceBurn= 
Membro
Mensagens 897 Gostos 3
Feedback +3

Troféus totais: 32
Trófeus: (Ver todos)
Windows User Level 6 Linux User Mobile User Super Combination Combination Topic Starter Poll Voter Poll Starter Level 5