add heartbeat to new log

master
IoTcat 5 years ago
parent 04aa00c17f
commit 4e5cb7438e
  1. 9
      server/cn/home/www/functions.php
  2. 35
      server/cn/home/www/log/heartbeat.php

@ -411,6 +411,15 @@ function get_from(){
elseif($_REQUEST['from']) return $_REQUEST['from'];
}
function get_from_domain(){
$str = str_replace("http://","",get_from());
$str = str_replace("https://","",get_from());
$strdomain = explode("/",$str);
return $strdomain[0];
}
/**functions for aplayer**/
//put this function to where you want the aplayer to dispaly

@ -18,33 +18,30 @@ if(isset($_REQUEST['cookie'])){
db__pushData($conn,"fp_cookie",array("fp" => $fp, "timestamp" => $tt, "cookie" => $cookie));
}else{
session_start();
session_start();
$_SESSION['s_fp']=$fp;
$_SESSION['s_ip']=$ip;
$_SESSION['s_fp']=$fp;
$_SESSION['s_ip']=$ip;
if(!isset($_SESSION['s_usrTel'])){
if(!isset($_SESSION['s_usrTel']))
{
if(db__rowNum($conn,"fp","fp",$fp))
{
$r_usr=db__getData($conn,"fp","fp",$fp);
if(db__rowNum($conn,"fp","fp",$fp)){
$r_usr=db__getData($conn,"fp","fp",$fp);
if(db__rowNum($conn,"user","tel",$r_usr[0]['usr']))
{
$res=db__getData($conn,"user","tel",$r_usr[0]['usr']);
if(db__rowNum($conn,"user","tel",$r_usr[0]['usr'])) {
$res=db__getData($conn,"user","tel",$r_usr[0]['usr']);
$_SESSION['s_usrTel']=$r_usr[0]['usr'];
$_SESSION['s_usr']=$res[0]['name'];
$_SESSION['s_ssr']=$res[0]['ssr'];
$_SESSION['s_usrTel']=$r_usr[0]['usr'];
$_SESSION['s_usr']=$res[0]['name'];
$_SESSION['s_ssr']=$res[0]['ssr'];
}
}
else
db__pushData($conn,"fp",array("fp"=>$fp,"ip"=>$ip));
}
else
db__pushData($conn,"fp",array("fp"=>$fp,"ip"=>$ip));
}
db__pushData($conn,"log",array("city"=>$city,"fp"=>$fp,"ip"=>$ip,"domain"=>$domain,"url"=>$from,"time"=>time()));
yimian__log("log_iis",array("city"=>$city,"fp"=>$fp,"ip"=>ip2long($ip),"domain"=>get_from_domain(),"url"=>$from,"timestamp"=>date('Y-m-d H:i:s', time())));
//echo json_encode(array("fp"=>$fp,"ip"=>$ip,"domain"=>$domain,"url"=>$from,"time"=>time()));
//echo json_encode(array("fp"=>$fp,"ip"=>$ip,"domain"=>$domain,"url"=>$from,"time"=>time()));
echo json_encode(array("usr"=>$_SESSION['s_usr'],"tel"=>$_SESSION['s_tel'],"fp"=>$_SESSION['s_fp'],"ip"=>$_SESSION['s_ip']));
}
Loading…
Cancel
Save