true);
}else{ //session存在
$num=page_count($connect,"website",false);
}
return $num;
}
function displayCount($num){
$fileurl="countpng.php?count=".$num;
return $fileurl;
}
//显示计数值,type为显示类型,length为显示的长度,缺省6
//type=1图形形式
//type=2文本形式(缺省)
function show_site_count($num,$length=6,$type=2){
$outStr=strval($num);
for ($i=strlen($outStr)+1;$i<=$length;$i++){
$outStr="0"."$outStr";
}
switch ($type){
case 1:
echo "<img src="";
echo displayCount($outStr);
echo "">";
break;
case 2:
default:
echo "$outStr";
}
}
?>
<?php
if (!isset($inc))exit;
$connect=mysql_connect('localhost','root',');//connect to server
mysql_select_db("damio",$connect); //select database ,database name is damio
$sitecount=site_count($connect);
if (isset($page_name))
page_count($connect,$page_name);
?>
}else{ //session存在
$num=page_count($connect,"website",false);
}
return $num;
}
function displayCount($num){
$fileurl="countpng.php?count=".$num;
return $fileurl;
}
//显示计数值,type为显示类型,length为显示的长度,缺省6
//type=1图形形式
//type=2文本形式(缺省)
function show_site_count($num,$length=6,$type=2){
$outStr=strval($num);
for ($i=strlen($outStr)+1;$i<=$length;$i++){
$outStr="0"."$outStr";
}
switch ($type){
case 1:
echo "<img src="";
echo displayCount($outStr);
echo "">";
break;
case 2:
default:
echo "$outStr";
}
}
?>
<?php
if (!isset($inc))exit;
$connect=mysql_connect('localhost','root',');//connect to server
mysql_select_db("damio",$connect); //select database ,database name is damio
$sitecount=site_count($connect);
if (isset($page_name))
page_count($connect,$page_name);
?>