Last active
August 29, 2015 14:24
-
-
Save Shaz3e/34e1909759dbdd419e98 to your computer and use it in GitHub Desktop.
Find out if your email has been read
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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(1,1); | |
$grigio = ImageColorAllocate($newimage,255,255,255); | |
ImageJPEG($newimage); | |
ImageDestroy($newimage); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When sending emails, you might want to be able to find out if your email has been read. Here’s a very interesting snippet which log the IP address which read your email, as well as the actual date and time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment