不多说了,每个方法都注释了,可以直接用: <?php //这个类似用来获取访客信息的 //方便统计 class visitorInfo { //获取访客ip public function getIp() { $ip=false; if(!empty($_SERVER["HTTP_CLIENT_IP"])){ $ip = $_SERVER["HTTP_CLIENT_IP"]; } if (!empty($_SERVER['HTTP_X_FORWARDED_FO
php中获取网站访客来源的关键词方法,收集了 <?php class keyword{ public function getKeyword($referer){ if(strpos($referer,"http://www.baidu.com")> -1 ){ $keyword = $this->getbaidukeyword($referer); }else if(strpos($referer,"http://www.google.com")
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta h
public class IPHelper { public static string GetVisitorsIPAddress() { string result = String.Empty; result = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; // 如果使用代理,获取真实IP ) //没有“.”肯定是非IPv4格式 result = null; else