Make Urtutorials.com your homepage | Add to Favorites      


Ip Logger  

IP logger
This tutorial will show you the basis of logging visitors IP's

Code:

Before starting you will need to create a new txt file. Leave the file blank and save it as ips.txt. After that, we goes to the code. This is a good way of keeping track of your visitors!

$log_file = "ips.txt";
// This is the file to which the IPs are logged in. 
$ip = getenv(\'REMOTE_ADDR\'); 
$fp = fopen("$log_file", "a");
fputs($fp, "$iprn");
flock($fp, 3); 
fclose($fp);
PRINT("your IP has been logged.....$ip");
// "your IP has been logged....." This is what will be displayed on your site. You can change it to say anything you want or you can delete it and leave it blank. $ip is the code that will be displaying the users IP. 
?>
 

You can either include it on a page or just put the code on the page.
 
Discuss this tutorial in the Forum.

Other good stuff:-


Submited by:- Farooq Azam

Discussions Forum Login:-

Username:
Password:  

Remember Me    
Not a member?
Register here

Copyright © UrTutorials.com - All rights ® reserved A Publispain Group Website