Grab and send by email users/hackers ip adress

locking

Newcomer
A few years ago I had a page with a bunch of MP3 songs that were hard to protect.
Many other webmasters where trying to locate the root of my music folders and then spread the links, but then i had a little script that i used to put as index.html in all directories that were not for my visitors.
Those who tried to locate the root just came to an empty page.
Index.html file had a code that automatically sent visitor's ip address to my e-mail, but now i have lost the code and can´t find no one on google either.
Anyone know the code? know that it took the remote address and it was something with stripslashes.


Thanks in advance :D:D
 
Most likely just some PHP code to get the visitors IP address then email you the IP.

eg:
Code:
<?php
$ip=$_SERVER['REMOTE_ADDR'];

$body = 'Someone from '.$ip.' just tried to visit your website at '.date('h:ia m/d/y',time());
$subject 'IP '.$ip.' just tried to visit your website';
$to = 'email@domain.com';
$from = 'admin@domain.com';

mail($to,$subject,$body,$from);
?>

A very simple implementation.
 
Hi Malo and thanks for the fast response, i am getting this error when accesing the script Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/79/5871079/html/www/index.php on line 5
 
Back
Top