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

Someone
Friday, July 21st, 2006 at 11:06:49pm MDT 

  1. <?php
  2.  
  3.  
  4. // connect to mysql script and stuff here
  5. $link = mysql_connect('MYSQLHOST','user','psw');
  6. mysql_select_db('dbname');
  7.  
  8. $sql = "SELECT DISTINCT 1 FROM ip_logs WHERE ip = '".mysql_real_escape_string($_SERVER[REMOTE_ADDR])."' LIMIT 1"
  9. $result = mysql_query($sql);
  10. list($present) = mysql_fetch_row($result);
  11.  
  12. if (!$present || !$result) {
  13.         // send your email here.
  14.         $ip = $_SERVER['REMOTE_ADDR'];
  15.         echo "<div id=ip>";
  16.         echo "Your Ip is:";
  17.         echo "<div></div>";
  18.         echo $ip;
  19.         //header
  20.         ini_set ("sendmail_from","ipmailer@i-trash.com");
  21.         // Your email address
  22.         $femail = "ipmailer@i-trash.com";
  23.         //to email
  24.         $toemail = "antonnid@gmail.com";
  25.         // The subject
  26.         $subject = "NEW IP: $ip ";
  27.         // The message
  28.         $message = $ip;
  29.         mail($toemail, $subject, $message, "From: $femail");
  30.         echo "</div>";
  31. }
  32.  
  33. $sql = "INSERT INTO ip_logs (ip, date) VALUES ('". $_SERVER[REMOTE_ADDR]."','".time()."')";
  34. $result = mysql_query($sql);
  35.  
  36.  
  37. ?>

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
fantasy-obligation