View source
<?php
function adserve_counter_image() {
adserve_variable('variable_load');
adserve_bootstrap(0);
$ad->aid = adserve_variable('aid');
if ($ad->aid) {
adserve_increment($ad);
}
else {
adserve_increment($ad, 'count');
}
if (function_exists('imagecreate')) {
$image = imagecreate(1, 1);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
}
else {
exit;
}
if (function_exists('imagejpeg')) {
header("Content-type: image/jpeg");
imagejpeg($image);
}
else {
if (function_exists('imagepng')) {
header("Content-type: image/png");
imagepng($image);
}
else {
if (function_exists('imagegif')) {
header("Content-type: image/gif");
imagegif($image);
}
}
}
imagedestroy($image);
exit(0);
}