php代理投票的简单例子

发布时间:2021-01-21编辑:脚本学堂
分享一个php实现的代码投票的简单代码,学习下snoopy类的用法,感兴趣的朋友参考下。

本节内容:
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类的用法