本节内容:
php代理投票
例子:
<?php
/**
* 代理投票
* by www.jb200.com
*/
$formvars["UserName"] = "0808";
$formvars["name"] = "脚本学堂";
$formvars["keyword"] = "1277";
$action = "http://www.***.com/Vote.asp";
include "Snoopy.class.php";
$snoopy = new Snoopy;
$snoopy->proxy_host = "156.35.2.54";
$snoopy->proxy_port = "80";
$snoopy->agent = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)"; //伪装浏览器
$snoopy->referer = "http://www.baidu.com"; //伪装来源页地址 http_referer
$snoopy->rawheaders["Pragma"] = "no-cache"; //cache 的http头信息
$snoopy->rawheaders["X_FORWARDED_FOR"] = "127.0.0.112"; //伪装ip
$snoopy->submit($action,$formvars);
echo $snoopy->results;
有关snoopy类库的例子,还可以参考:
php Snoopy获取网站编码
php Snoopy类的用法