0
如何在簡單的php dom解析器中添加訪問者瀏覽器信息ip。 PHP Simple HTML DOM Parser如何在簡單的php dom解析器中添加訪問者瀏覽器信息ip簡單的php dom解析器
如何在簡單的php dom解析器中添加訪問者瀏覽器信息ip。 PHP Simple HTML DOM Parser如何在簡單的php dom解析器中添加訪問者瀏覽器信息ip簡單的php dom解析器
是的,這是可能的,你可以添加你喜歡的功能。下面是例子:
$header = array();
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Accept-Language: en-us,en;q=0.5";
$header[] = "Pragma: "; // browsers keep this blank.
curl_setopt($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');
curl_setopt($this->curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($this->curl,CURLOPT_COOKIEJAR, $cookieJar);
curl_setopt($this->curl,CURLOPT_COOKIEFILE, $cookieJar);
curl_setopt($this->curl,CURLOPT_AUTOREFERER, true);
curl_setopt($this->curl,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->curl,CURLOPT_RETURNTRANSFER, true);
謝謝,我會嘗試 – HasanTG
爲了讓它工作而做了什麼努力? – JvdBerg
我不明白你想要做什麼。 –