Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

coldsteal
Friday, July 21st, 2006 at 10:37:05pm MDT 

  1. // connect to mysql script and stuff here
  2. $link = mysql_connect('MYSQLHOST','user','psw');
  3. mysql_select_db('dbname');
  4. $sql = "INSERT INTO ip_logs (ip, date) VALUES ('". $_SERVER[REMOTE_ADDR]."','".time()."')";
  5. $result = mysql_query($sql);
  6.  
  7. $sql = "SELECT * FROM table"; //change table to whatever your table name
  8. is
  9. $result = mysql_query($sql);
  10.  
  11. $test = FALSE;
  12.  
  13. while($row = mysql_fetch_assoc($result))
  14. {
  15.   if($row['ip']==$_SERVER['REMOTE_ADDR'])
  16.   {
  17.     $test = TRUE;
  18.     exit();
  19.   }
  20. }
  21.  
  22. if(!$test)
  23. {
  24.  //GET IP
  25. $ip = $_SERVER['REMOTE_ADDR'];
  26. echo "<div id=ip>";
  27. echo "Your Ip is:";
  28. echo "<div></div>";
  29. echo $ip;
  30. //header
  31. ini_set ("sendmail_from","ipmailer@i-trash.com");
  32. // Your email address
  33. $femail = "ipmailer@i-trash.com";
  34. //to email
  35. $toemail = "antonnid@gmail.com";
  36. // The subject
  37. $subject = "NEW IP: $ip ";
  38. // The message
  39. $message = $ip;
  40. mail($toemail, $subject, $message, "From: $femail");
  41. echo "</div>";
  42.  
  43. }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right
fantasy-obligation
fantasy-obligation