打印本文 打印本文  关闭窗口 关闭窗口
计数器详细设计
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:35:33
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);
?>

上一页  [1] [2] 



打印本文 打印本文  关闭窗口 关闭窗口