|
肯定是动态技术,下面是用php写的一个计数器代码:<br /><?php<br /> Header( "Content-type: image/png");<br /> //读入Counter文件<br /> $fp = fopen("counter.txt", "r");<br /> $Counter = fgets($fp, 10);<br /> fclose($fp); <br /> //写入计数器文件中<br /> $fp = fopen("counter.txt", "w");<br /> $Counter = $Counter+1;<br /> fputs($fp, $Counter);<br /> fclose($fp);<br /> <br /> $Counter = sprintf( "%'08d", $Counter);<br /> <br /> //创建image<br /> $img = ImageCreate(80, 18);<br /> $blue = ImageColorAllocate($img, 0, 0, 255);<br /> $red = ImageColorAllocate($img, 255, 0, 0);<br /> ImageString($img, 5, 5, 1, $Counter, $red);<br /> <br /> //输出图片<br /> ImagePNG($img);<br /> ImageDestroy($img);<br />?><br /><br />点击次数记录在:Counter.txt里 |
|