Jump to content

Pixel Image not logged, Basic conversion tracking


dflow

Recommended Posts

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?

Link to comment
Share on other sites

Remove the error suppression ( the @) from in front of the fopen, fwrite and fclose functions and turn error reporting on. They could be returning an error when trying to write to the log. If an error occurs then nothing will be written to the log.

 

Also what is the purpose of    $check = strpos($search, $log);

Edited by Ch0cu3r
Link to comment
Share on other sites

Remove the error suppression ( the @) from in front of the fopen, fwrite and fclose functions and turn error reporting on. They could be returning an error when trying to write to the log. If an error occurs then nothing will be written to the log.

 

Also what is the purpose of    $check = strpos($search, $log);

 

I used a quick script I found, I removed the $check and still I the <img> is not logged and no errors, the log works when I reload pixelimage.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.