我有脚本这段代码:
require_once 'Request2.php';
$request = new HTTP_Request2('http://fakevisit.blogfa.com/');
$request->setHeader(array(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding: gzip, deflate',
'Accept-Language: en-US,en;q=0.5',
'Connection: keep-alive',
'Ip: 88.168.25.98',
'SomeBull: BeingIgnored',
'Referer: http://www.google.com',
'User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)'
));
$response = $request->send();
echo "Response body:\n" . $response->getBody();
该程序每 1 分钟运行一次 运行正常。但在 google analytics 和其他计数器脚本中不会添加到访问者!在这条线上
echo "Response body:\n" . $response->getBody();
使用脚本显示访问者数量的页面的全部内容在页面中正确显示。