PDA

View Full Version : [TUT] Making your own ip catcher



mapleanton
01-05-2011, 10:56 AM
This will get the ip of the user that goes to your page. The log will be saved in the same map as ip_log.txt. The user will be redirected to (in this case) Google (http://www.google.com)



<?php
$ip = $_SERVER['REMOTE_ADDR'];
$dt = date("l dS \of F Y h:i:s A");
$file=fopen("ip_log.txt","a"); //ip_log.txt = Where it needs to save to. Here it must be hosted in same map !
$data = $ip.' '.$dt."\n";
fwrite($file, $data);
fclose($file);
header( 'Location: http://www.google.com' ) ; //www.google.com = Site where it needs to redirected to
?>


:] MapleAnton ~

KingofPop
01-05-2011, 09:27 PM
Thanks... Il sure be using this soon.

ScrubStar
01-06-2011, 12:11 AM
ty man ..

mapleanton
01-13-2011, 11:41 AM
There is also a button :]