how do i put it in my stie???
<?
/* Craze's IP Logger */
/* By Seena Zandipour */
/* Put this script in your 404 Message so when people try to access your hidden files,
their IP will be logged in many ways!!! */
/* connect to database */
$conn = mysql_connect("localhost","username", "password") or die(mysql_error());
mysql_select_db(database1, $conn) or die(mysql_error());
/* get the users ip address */
$ip = $SERVER['REMOTE_ADDR'];
/* get today's date and time */
$date = date('m/d/Y - h:m A');
if($ip){
/* Send an email to the admin with users IP */
$mail = mail('admin@site.net', 'ip logged!', 'A user with the IP of $ip has tried to
view secret files. Please goto http://www.locateip.via.name/ to figure out where that
bastard lives, and hunt him down!');
/* Log the IP in a datbase */
$query = mysql_query("INSERT INTO ip_log (ip,date) VALUES ('$ip', '$date')") or
die(mysql_error());
/* Log the ip in a flatfile (txt document) */
$file = fopen("iplog.txt", "w");
$write = fwrite($file, "\n IP ADDRESS: $ip, DATE: $date");
fclose($file);
if($mail){
echo "Mail sent to admin!";
}
if($query){
echo "User IP Logged in database!";
}
if($write){
echo "User IP logged in text file!";
}
echo "Task Complete!";
}
?>
and PHP codes
<?
/* Craze's IP Logger */
/* By Seena Zandipour */
/* Put this script in your 404 Message so when people try to access your hidden files,
their IP will be logged in many ways!!! */
/* connect to database */
$conn = mysql_connect("localhost","username", "password") or die(mysql_error());
mysql_select_db(database1, $conn) or die(mysql_error());
/* get the users ip address */
$ip = $SERVER['REMOTE_ADDR'];
/* get today's date and time */
$date = date('m/d/Y - h:m A');
if($ip){
/* Send an email to the admin with users IP */
$mail = mail('admin@site.net', 'ip logged!', 'A user with the IP of $ip has tried to
view secret files. Please goto http://www.locateip.via.name/ to figure out where that
bastard lives, and hunt him down!');
/* Log the IP in a datbase */
$query = mysql_query("INSERT INTO ip_log (ip,date) VALUES ('$ip', '$date')") or
die(mysql_error());
/* Log the ip in a flatfile (txt document) */
$file = fopen("iplog.txt", "w");
$write = fwrite($file, "\n IP ADDRESS: $ip, DATE: $date");
fclose($file);
if($mail){
echo "Mail sent to admin!";
}
if($query){
echo "User IP Logged in database!";
}
if($write){
echo "User IP logged in text file!";
}
echo "Task Complete!";
}
?>
and PHP codes