[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 900
  • Last Modified:

php pixel for image tracking

I am looking for a way to do some basic tracking with php.

I need to do the basic 1x1 gif pixel, white... (i remember transparent being a bit more work last time...)

I have my htaccess file set up so I can process the file as a php file.

Thanks.  
This is my htaccess file.
it's in the main folder that I am doing the testing in.
 
 
#=======================================#
AddHandler x-httpd-php .php .html .gif
#=======================================#

Open in new window

0
cntmedia1
Asked:
cntmedia1
1 Solution
 
Ray PaseurCommented:
Why not just use Google Analytics?
0
 
cntmedia1Author Commented:


function makeImage()
{
   
 
header("Content-type: image/gif");

$img = @imagecreate(300,100) or die('GD error');

$background_color = imagecolorallocate($img,50,50,50);
$text_color = imagecolorallocate($img,0,0,50);

imagestring($img,1,1,1,"a", $text_color);

$img2 = imagecreate(1000,2);
imagecopyresampled($img2,$img,0,0,0,0,1,1,125,80);

$background_color = imagecolortransparent($img2,$background_color);

imagegif($img2);
imagedestroy($img);
imagedestroy($img2);

}

makeImage();

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now