我正在进行像素跟踪但是当我尝试使用cURL获取HTTP标头时,它会返回:
Output http://image.prntscr.com/image/644e0c04a08e445c82e3381eed3b42f4.jpeg
当前代码:
<?php
$img = imagecreate(1,1);
$white = imagecolorallocate($img, 255, 255, 255);
imagesetpixel($img,1,1,$white);
header("content-type: image/jpg");
imagejpeg($img);
imagedestroy($img);
$file = fopen("results.txt", "a");
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("r");
fwrite($file, "$ip from: $_SERVER['HTTP_REFERER'] at $date");
fclose($file);
?>
答案 0 :(得分:1)
PHP:
<?php
$file = fopen("results.txt", "a");
$ip = $_SERVER['REMOTE_ADDR'];
$date = date("r");
fwrite($file, "$ip from: $_SERVER['HTTP_REFERER'] at $date");
fclose($file);
$img = imagecreate(1,1);
$white = imagecolorallocate($img, 255, 255, 255);
imagesetpixel($img,1,1,$white);
header("content-type: image/jpg");
ob_clean();
imagejpeg($img);
imagedestroy($img);