最简单的方法是使用油脂类(https://addons.mozilla.org/en-
US/firefox/addon/greasemonkey/)之类的方法,但是更好的解决方案是使用firebug的“
net”选项卡捕获发送的帖子当您填写表格并使用CURL(http://php.net/manual/en/book.curl.php)重复该帖子时
function post($url,$data) { $process = curl_init($url); curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers); curl_setopt($process, CURLOPT_HEADER, 1); curl_setopt($process, CURLOPT_USERAGENT, $this->user_agent); if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_cookieFILE, $this->cookie_file); if ($this->cookies == TRUE) curl_setopt($process, CURLOPT_cookieJAR, $this->cookie_file); curl_setopt($process, CURLOPT_ENCODING , $this->compression); curl_setopt($process, CURLOPT_TIMEOUT, 30); if ($this->proxy) curl_setopt($process, CURLOPT_PROXY, $this->proxy); curl_setopt($process, CURLOPT_POSTFIELDS, $data); curl_setopt($process, CURLOPT_RETURNTRANSFER, 1); curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($process, CURLOPT_POST, 1); $return = curl_exec($process); curl_close($process); return $return; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)