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.
- error_reporting (0);
- Header ("Content-type:image/jpeg");
- Get IP
- if (!emptyempty ($_server[' http_client_ip '))
- {
- $ip =$_server[' http_client_ip '];
- }
- ElseIf (!emptyempty ($_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 (1,1);
- $grigio = Imagecolorallocate ($newimage, 255,255,255);
- Imagejpeg ($newimage);
- Imagedestroy ($newimage);
- ?>
how PHP sends messages