Require (' common.inc ');
$ip = $REMOTE _addr;
$current =getdate (Time ());
$day = $current ["Mday"];
$query = "SELECT * from Count";
$result =mysql (and PHP collocation of the best combination) _db_query (' Football ', $query, $link);
while ($row =mysql (the best combination of PHP collocation) _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 first". $num;
echo "Visitor";
$query 1= "INSERT into count values (' $ip ', $day, $num)";
MySQL (and PHP collocation of the best combination) _db_query (' Football ', $query 1, $link);
}
Else
{
echo "You are the first". $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 of PHP collocation) _connect ("localhost", "root", "");
?>
The Library is:
Football
Table:
Count
Field: Ip->char (20)
Day->int (2)
Num->int (8)
This program can be a multi-user register with a little modification, and can not be false yo!
For personal use only!
http://www.bkjia.com/PHPjc/509062.html www.bkjia.com true http://www.bkjia.com/PHPjc/509062.html techarticle require (' common.inc '); ip=remote_addr; Current=getdate (Time ()); day=current["Mday"]; query= "SELECT * from Count" ; Result=mysql (and PHP collocation of the best combination) _db_query (' Foot ...