最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

一個(gè)自定義位數(shù)的php多用戶(hù)計(jì)數(shù)器代碼

 更新時(shí)間:2007年03月11日 00:00:00   作者:  
此計(jì)數(shù)器能夠自定義任意位數(shù),而且在免費(fèi)提供的時(shí)候能夠顯示一個(gè)簡(jiǎn)單的廣告。
運(yùn)行的時(shí)候需要在計(jì)數(shù)器目錄下創(chuàng)建一個(gè)nobody帳戶(hù)有權(quán)改寫(xiě)的目錄datas.
實(shí)際運(yùn)行的例子在
http://www.hnpts.ha.cn/freecount.htm
<?
Header("Content-type: image/png");
if ($user=="") $user="test";
$fn="datas/".$user.".txt";
if ($bit=="") $bit=8;   //取默認(rèn)值
if (is_readable($fn)) {$f=fopen($fn,"r");
$c=fgets($f,255);fclose($f);} //讀出原來(lái)的計(jì)數(shù)值
else $c="0"; //新用戶(hù)
$l=strlen($c);  //計(jì)算實(shí)際值長(zhǎng)度
$cnt="";
for ($i=0;$i<$bit-$l;$i++) $cnt.="0";//前面加“0”補(bǔ)足指定的位數(shù)
$cnt.=$c;$c1=intval($c);$c1++;
$f=fopen($fn,"w");fputs($f,$c1);fclose($f); //寫(xiě)回
  $font=20;
if (($c1%10==9)&&($user!="test")) {$cnt="www.hnpts.ha.cn";$font=16;}
//達(dá)到條件就顯示廣告
$s=ImageTTFBBox($font,0,"times.ttf", $cnt);
$x=abs($s[4])+8;$y=abs($s[5])+7;
$im = imagecreate($x,$y);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
if ($font==20) {$green = ImageColorAllocate($im, 0,255,0);
imagerectangle($im,1,1,$x-2,$y-2,$white);}
else $green = ImageColorAllocate($im, 255,255,255);
ImageTTFText($im,$font,0, 3,$y-5, $green, "times.ttf", $cnt);
ImagePng($im);
ImageDestroy($im);
?>

相關(guān)文章

最新評(píng)論

新野县| 西昌市| 随州市| 本溪| 新营市| 五常市| 呼和浩特市| 扶风县| 陆丰市| 海阳市| 龙泉市| 云林县| 额济纳旗| 新龙县| 武清区| 阜康市| 桂林市| 乾安县| 沙田区| 枞阳县| 青海省| 酒泉市| 黄山市| 五常市| 宁晋县| 莒南县| 河曲县| 修武县| 龙山县| 拉萨市| 海原县| 南川市| 赤城县| 苏尼特右旗| 唐山市| 泰和县| 雅安市| 伊宁市| 景德镇市| 定日县| 玉门市|