Skip to content

Instantly share code, notes, and snippets.

@vbaert
Created August 2, 2012 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vbaert/3235893 to your computer and use it in GitHub Desktop.
Save vbaert/3235893 to your computer and use it in GitHub Desktop.
image to put in email to check if mail has been read
<?php
if(isset($_GET['uid']) && isset($_GET['mid'])){
$mailid = (int)$_GET['mid'];
$userid = (int)$_GET['uid'];
$db = new mysqli_connect('databaseserver', 'databaseuser', 'databasepassword', 'databasename');
$db->query("INSERT INTO mailreaders (mailid, userid) VALUES ($mailid, $userid)");
$im=imagecreatetruecolor(1,1);
$white=imagecolorallocate($im,255,255,255);
imagefilledrectangle($im,0,0,1,1,$white);
header("content-type: image/jpeg");
imagejpeg($im);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment