Program | Flow >create Table Stream (
IP text,
stime int,
visits int,
info text);
?
if ($day <0) $day = 0;
$mlink =mysql_connect (' localhost ', ' Ajax ', ' xxxxxxx ');
Statistics to date the total number of pages browsed
$query = "Select SUM (visits) as tvisits from stream";
$result =mysql_db_query (' Ajax ', $query, $mlink);
Echo ' <span class= "St1" > browse the total cumulative number of pages: ';
if ($row =mysql_fetch_object ($result)) {
Echo $row->tvisits;
}
$stoday 1=mktime (0,0,0,date (M, $ctime 1), date (d, $ctime 1), date (Y, $ctime 1));
$stoday 2=mktime (0,0,0,date (M, $ctime 2), date (d, $ctime 2), date (Y, $ctime 2));
Count the cumulative number of pages browsed on the same day
$query = ' Select SUM (visits) as tvisits from stream where stime>= ';
$query. = $stoday 1. ' and stime< '. $stoday 2;
$result =mysql_db_query (' Ajax ', $query, $mlink);
Echo ' <span class= "ST3" > Browse homepage Cumulative number of times: ';
if ($row =mysql_fetch_object ($result)) {
Echo $row->tvisits;
}
Count the number of IP calls on the day
$query = ' SELECT * from stream where stime>= '. $stoday 1;
$query. = ' and stime< '. $stoday 2. ' ORDER by stime DESC ';
$result =mysql_db_query (' Ajax ', $query, $mlink);
echo "
Total visitors: ". mysql_num_rows ($result);
Echo ' </span>Echo ' <table border= "0" width= "100%" cellspacing= "0" cellpadding= "2" class= "ST3" > ";
Echo ' <tr><td nowrap class= "st2" >ip site </td>
<TD nowrap class= "St2" > Recent time </td>
<TD nowrap class= "St2" > Times </td>
<TD nowrap class= "ST2" > User information </td> ';
echo "</tr>";
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.