![](/img/trans.png)
[英]how can i get the number of visitors using Google analytics Restful
[英]how can i know the number of visitors on the website?
嗨,大家好,我想知道如何計算所有頁面(而非一頁)的訪問者人數,例如,我將此代碼放在一頁中,並以此計算頁面訪問者的數量,而不是針對所有訪問者在所有頁面上。
<?php
$time=time();
$ip=$_SERVER['REMOTE_ADDR'];
$timeout=$time-300;
$query1=mysql_query("delete from online where ip='$ip'")or die (mysql_error());
$query2=mysql_query("delete from online where time<$timeout")or die (mysql_error());
$query3=mysql_query("insert into online values('','$ip','$time')")or die (mysql_error());
$query4=mysql_query("select * from online ")or die (mysql_error());
echo $num=mysql_num_rows($query4);
?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.