国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

改進(jìn)的IP計(jì)數(shù)器

2024-05-04 23:01:22
字體:
供稿:網(wǎng)友
<?  
//require (’common.inc’);  
$arr_request=array();  
if (count($http_get_vars))  
    {  
    while (list($key,$value)=each($http_get_vars))  
    {  
        $arr_request[strtolower($key)]=$value;  
    }  
}  
if (count($http_post_vars))  
{  
    while (list($key,$value)=each($http_post_vars))  
    {  
        $arr_request[strtolower($key)]=$value;  
    }  
}  
$[email protected]_connect("localhost","kong","kong");  
mysql_select_db("mywebdb");
$ip=$remote_addr;  
$current=getdate(time());  
$day=$current["mday"];  
$query="select * from addcount where day=/"$day/"";
$[email protected]_query($query);
if(!$[email protected]_num_rows($result))
    $num=1;
while($[email protected]_fetch_row($result))
{  
    if (strcmp($ip,$row[1])==0)  
    {  
        $i=1;
        $id=$row[0];
        $click=$row[3]+1;
        $up="update addcount set click_count=click_count+1 where id=$id";  
        $[email protected]_query($up);
//        break;
    }  
    $total+=$row[3];
}  
$total++;
if(!$i){
    $query1="insert into addcount (ip,day,click_count )values ('$ip','$day',1)";  
    mysql_db_query("mywebdb",$query1,$link);  
    $click=1;
}
echo "<html><head><title>計(jì)數(shù)器</title></head>";
    echo "你是第" .$num."訪問者<br>";
    echo "今天你第".$click."次點(diǎn)擊<br>";
    echo "今天總點(diǎn)擊".$total."次<br>";

/*
表:  
addcount  
create table addcount (
   id int(6) default '0' not null auto_increment,
   ip char(20) not null,
   day int(2) not null,
   click_count int(3) not null,
   primary key (id)
);
*/
?>  


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 沂水县| 徐闻县| 高阳县| 霞浦县| 贺州市| 柳河县| 崇仁县| 巴南区| 英超| 峨边| 曲沃县| 静宁县| 玛多县| 三亚市| 卢湾区| 江孜县| 分宜县| 秦安县| 建阳市| 永宁县| 孝义市| 古交市| 商河县| 五莲县| 金堂县| 江孜县| 德格县| 香港| 荣昌县| 舟曲县| 阿瓦提县| 甘肃省| 防城港市| 新宁县| 通榆县| 阳西县| 保定市| 吉安县| 蒲江县| 鹤山市| 仁怀市|