Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
动态横幅与PHP GD?每次加载时刷新缓存?_Php_Caching_Php Gd - Fatal编程技术网

动态横幅与PHP GD?每次加载时刷新缓存?

动态横幅与PHP GD?每次加载时刷新缓存?,php,caching,php-gd,Php,Caching,Php Gd,我有一个在我的论坛签名横幅,我想跟踪它的意见数量。我愿意使用PHP GD对图像进行编码,并在每次访问时增加计数器 下面是我现在为banner.php编写的代码(尚未实现计数器): 问题是,我的浏览器似乎正在缓存这些内容,因此,每次在img标记中调用页面时都不会加载代码 任何帮助都将不胜感激 <?php header('Content-encoding: none'); header("content-type:image/jpg"); header("Cache-Contr

我有一个在我的论坛签名横幅,我想跟踪它的意见数量。我愿意使用PHP GD对图像进行编码,并在每次访问时增加计数器

下面是我现在为banner.php编写的代码(尚未实现计数器):


问题是,我的浏览器似乎正在缓存这些内容,因此,每次在img标记中调用页面时都不会加载代码

任何帮助都将不胜感激

<?php
  header('Content-encoding: none');
  header("content-type:image/jpg");
  header("Cache-Control: private, no-cache, no-cache=Set-Cookie, proxy-revalidate");
  header("Expires: Wed, 11 Jan 2000 12:59:00 GMT");
  header("Last-Modified: Wed, 11 Jan 2006 12:59:00 GMT");
  header("Pragma: no-cache");
  // Create an image, 728x90 pixel in size
  $im=imagecreate(728,90);

  // Set the background colour
  $black=imagecolorallocate($im,0,0,0);

  // Allocate the background colour
  imagefilledrectangle($im,0,728,0,90,$black);

  // Create a JPEG file from the image
  imagejpeg($im);

  // Free memory associated with the image
//  imagedestroy($im);

?>