Use IP addresses to count the number of visitors! Take the day as the limit !.? Require ('Common. inc '); ipREMOTE_ADDR; currentgetdate (time (); daycurrent [mday]; queryselect * fromcount; resultMySQL (best combination with PHP) _ db_query ('foot Require ('Common. Inc ');
$ Ip = $ REMOTE_ADDR;
$ Current = getdate (time ());
$ Day = $ current ["mday"];
$ Query = "select * from count ";
$ Result = MySQL (the best combination with PHP) _ db_query ('football', $ query, $ link );
While ($ row = MySQL (the best combination with PHP) _ fetch_row ($ result ))
{
$ Num = $ row [2];
If (strcmp ($ ip, $ row [0]) = 0 & $ day = $ row [1])
{
$ I = 1;
}
}
If ($ I <> 1)
{
+ + $ Num;
Echo "you are the number". $ num;
Echo "visitor ";
$ Query1 = "insert into count values ('$ IP', $ day, $ num )";
MySQL (best combination with PHP) _ db_query ('football', $ query1, $ link );
}
Else
{
Echo "you are the number". $ num;
Echo "visitor ";
}
?>
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;
}
}
$ Link = MySQL (the best combination with PHP) _ connect ("localhost", "root ","");
?>
Library:
Football
Table:
Count
Field: ip-> char (20)
Day-> int (2)
Num-> int (8)
This program can be used as a multi-user stenographer with slight modifications, and cannot be falsified!
For personal use only!
Http://www.bkjia.com/PHPjc/509062.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/509062.htmlTechArticle? Require ('Common. inc '); ip = REMOTE_ADDR; current = getdate (time (); day = current ["mday"]; query = "select * from count "; result = MySQL (the best combination with PHP) _ db_query ('foot...