Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My ip logger with email and html logging option
#1
PHP Code:
<?php


$image 
"pizza.gif";  ///you need to upload your own gif image
$use_htmlog 0;
$htmlfile "baby.htm";
$use_mail 1;
$your_email "youremail-CHANGE-this-to-youremail";

$ip=getenv("REMOTE_ADDR");
$hostname gethostbyaddr($ip);
$httpagent=getenv("HTTP_USER_AGENT");
$httprefer=getenv("HTTP_REFERER");

$date date("D, m-d-y");
$time date("g:i A");

$name "baby";
$email "freakin@visitor.com";
$subject "visitor logged ".$ip." - ".$hostname." - agent: ".$httpagent." - refer: ".$httprefer;
$message "\nvisitor logged: ".$ip." - ".$hostname."\nagent: ".$httpagent."\nrefer: ".$httprefer."\n\n";
$headers  "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Mailer: fudge you Emailer\n";
$headers .= "From: \"".$name."\" <".$email.">\n";

if(
$use_mail) {
    
mail($your_email,$subject,$message,$headers);
}


if(
$use_htmlog) {
$logfile fopen($htmlfile"a");
fputs($logfile"<b>IP: </b>$ip ($hostname) - <b>INFO: </b>$httpagent on $date at $time - <b>from: </b> $httprefer <br>\n\n");
fclose($logfile);
}

if(!
file_exists($image)) {
  die(
"No image");
}

function 
LoadGif($imgname)
{
$im = @imagecreatefromgif($imgname);
if(!
$im)
{
$im imagecreatetruecolor (15030);
$bgc imagecolorallocate ($im255255255);
$tc imagecolorallocate ($im000);
imagefilledrectangle ($im0015030$bgc);
imagestring ($im155'Error'$tc);
}
return 
$im;
}

Header("Content-type:  image/gif");
Header("Cache-control:  no-cache"); 
Header("Pragma:  no-cache"); 
Header("Last-modified: ".gmdate("D M d h:i:s Y",time())." GMT"); 
Header("Expires: ".gmdate("D M d h:i:s Y",time()+1)." GMT"); 
$img LoadGif($image);
imagegif($img);
imagedestroy($img);


?>
Reply
#2
thanks it's work Thumbsup
Reply
#3
damn...how you did that

btw do you use bots or what
Reply
#4
Why in the hell would you make a script to email you a log of the IPs. If you did this on a forum the email inbox would fill in the matter of a few hours.
Reply
#5
(04-13-2010, 10:02 PM)SLiM Wrote: Why in the hell would you make a script to email you a log of the IPs. If you did this on a forum the email inbox would fill in the matter of a few hours.

Exactly what I was thinking!!
Reply
#6
applause for you.Perfect c0ding.
Reply
#7
Its okay, although i would modify this so it saves it on a text file on a web server. So it doesn't fill your inbox up.
[Image: angelsig.jpg]


Reply
#8
Good Work dude Thanks Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Woocommerce Product Add-ons - Auto-select first option EFitzpatr7 0 1,410 04-21-2016, 02:09 AM
Last Post: EFitzpatr7
  HTML&PHP Games. flAmingw0rm 25 4,454 06-04-2011, 07:23 AM
Last Post: Strafeness
  HTML Website Anon 6 2,366 06-01-2011, 03:26 AM
Last Post: !LoL
  1x1 pixel IP Logger Nyx- 22 6,277 04-16-2010, 03:27 AM
Last Post: .:xX[ThunderStorm]Xx:.
  [HELP] HTML Form/ Priority Dutchcoffee 5 3,740 01-02-2010, 02:07 AM
Last Post: manipulate

Forum Jump:


Users browsing this thread: 1 Guest(s)