I have the following <img> on a completed.php after a signup.php
<img src="http://example.com/pixelimage.php?AffID=98798" width="1" height="1">
the pixel is generated here pixelimage.php
<?php
// Create an image, 1x1 pixel in size
$im=imagecreate(1,1);
// Set the background colour
$white=imagecolorallocate($im,255,255,255);
// Allocate the background colour
imagesetpixel($im,1,1,$white);
// Set the image type
header("content-type:image/jpg");
// Create a JPEG file from the image
imagejpeg($im);
// Free memory associated with the image
imagedestroy($im);
if (isset($_GET['AffID'])) {
// $query_add="UPDATE auth_table SET etat = replace(etat,'$anc','$nv') where user_id LIKE
// '%$log%'";
// $query_exec=mysql_query($query_add) or die(mysql_error());
// <script language='JavaScript'>alert('Activation termine')</script>
echo $AffID = $_GET['AffID'];
$date = date("Y-d-m");
$hour = date("H:i");
$op=$date.$hour.'Affiliate ID : '.$AffID;
$op .= "\n";
$file = 'log.txt';
$search = file_get_contents($file);
$check = strpos($search, $log);
if ($check === FALSE) {
$fp = @fopen($file, 'a');
$write = @fputs($fp, $op);
@fclose($fp);
}
}
?>
the image is generated but the action does not get logged.
I can only get it logged when I reload the completed.php page.
what did I mess up?