PHP to see if the message has been read

Source: Internet
Author: User

When you are sending a message, you may be wondering if the email has been read by the other person. Here's a very interesting piece of code that shows the actual date and time that the other IP address records the read.

  1. error_reporting (0);
  2. Header ("Content-type:image/jpeg");
  3. Get IP
  4. if (!emptyempty ($_server[' http_client_ip '))
  5. {
  6. $ip =$_server[' http_client_ip '];
  7. }
  8. ElseIf (!emptyempty ($_server[' http_x_forwarded_for '))
  9. {
  10. $ip =$_server[' http_x_forwarded_for '];
  11. }
  12. Else
  13. {
  14. $ip =$_server[' remote_addr '];
  15. }
  16. Time
  17. $actual _time = time ();
  18. $actual _day = Date (' Y.m.d ', $actual _time);
  19. $actual _day_chart = Date (' d/m/y ', $actual _time);
  20. $actual _hour = Date (' h:i:s ', $actual _time);
  21. Get Browser
  22. $browser = $_server[' http_user_agent '];
  23. LOG
  24. $myFile = "Log.txt";
  25. $fh = fopen ($myFile, ' A + ');
  26. $stringData = $actual _day. ' ' . $actual _hour. ' ' . $ip. ' ' . $browser. ' ' . "\ r \ n";
  27. Fwrite ($FH, $stringData);
  28. Fclose ($FH);
  29. Generate Image (Es. Dimesion is 1x1)
  30. $newimage = Imagecreate (1,1);
  31. $grigio = Imagecolorallocate ($newimage, 255,255,255);
  32. Imagejpeg ($newimage);
  33. Imagedestroy ($newimage);
  34. ?>

how PHP sends messages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.