PHP Implementation Method _php tutorial to see if a message has been read

Source: Internet
Author: User
When you send an email, you may be wondering if the message 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 record was read.
Copy CodeThe code is as follows:
error_reporting (0);
Header ("Content-type:image/jpeg");

Get IP
if (!empty ($_server[' http_client_ip '))
{
$ip =$_server[' http_client_ip '];
}
ElseIf (!empty ($_server[' http_x_forwarded_for '))
{
$ip =$_server[' http_x_forwarded_for '];
}
Else
{
$ip =$_server[' remote_addr '];
}

Time
$actual _time = time ();
$actual _day = Date (' Y.m.d ', $actual _time);
$actual _day_chart = Date (' d/m/y ', $actual _time);
$actual _hour = Date (' h:i:s ', $actual _time);

GET Browser
$browser = $_server[' http_user_agent ');

LOG
$myFile = "Log.txt";
$fh = fopen ($myFile, ' A + ');
$stringData = $actual _day. ' ' . $actual _hour. ' ' . $ip. ' ' . $browser. ' ' . "\ r \ n";
Fwrite ($FH, $stringData);
Fclose ($FH);

Generate Image (Es. Dimesion is 1x1)
$newimage = Imagecreate (a);
$grigio = Imagecolorallocate ($newimage, 255,255,255);
Imagejpeg ($newimage);
Imagedestroy ($newimage);

?>

http://www.bkjia.com/PHPjc/621706.html www.bkjia.com true http://www.bkjia.com/PHPjc/621706.html techarticle when you send an email, you may be wondering if the message 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 record was read ...

  • 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.