<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?35</link>
<title><![CDATA[PHP控制路由器自动换IP]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[PHP]]></category>
<pubDate>Mon, 29 Jan 2007 04:40:55 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?35</guid> 
<description>
<![CDATA[ 
	　　我们经常会碰到需要自动换IP的需求，比方模拟点击投票，数据采集被封IP，Alexa作弊等等，也就是需要经常换IP的，我们都可以通过PHP控制路由器来换IP，这样就不需要用按键精灵搞得那么累了。呵呵。<br/>　　有的路由器是提供通过WEB方式管理路由器设置的，中间有一个功能就是断线和重新连接，我们就利用这个功能，呵呵，下面看代码：<br/><br/><div class="code">&lt;?php<br/><br/>function url($target=&#039;&#039;)<br/>{<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;$server &nbsp;= &#039;192.168.1.1&#039;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// IP address<br/> &nbsp; &nbsp; &nbsp; &nbsp;$host &nbsp; &nbsp;= &#039;192.168.1.1&#039;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Domain name<br/> &nbsp; &nbsp; &nbsp; &nbsp;$port &nbsp; &nbsp;= 80;<br/> &nbsp; &nbsp; &nbsp; &nbsp;$referer = &#039;http://&#039;.$host.$target; &nbsp; &nbsp;// Referer<br/> &nbsp; &nbsp; &nbsp; &nbsp;<br/> &nbsp; &nbsp; &nbsp; &nbsp;$username = &quot;admin&quot;;#ADSL的路由的用户名<br/> &nbsp; &nbsp; &nbsp;$password = &quot;admin&quot;;#ADSL的路由的管理密码<br/> &nbsp; &nbsp; &nbsp;$authorization = base64_encode($username.&quot;:&quot;.$password);<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;$File = fsockopen($server, $port, $errno, $errstr, 30);<br/> &nbsp; &nbsp; &nbsp; &nbsp;if ($File) <br/> &nbsp; &nbsp; &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$out = &quot;GET $target HTTP/1.1&#92;r&#92;n&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$out .= &quot;Host: $host&#92;r&#92;n&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$out .= &quot;Referer: $referer&#92;r&#92;n&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$out .= &quot;Authorization: Basic $authorization&#92;r&#92;n&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$out .= &quot;Connection: Close&#92;r&#92;n&#92;r&#92;n&quot;;<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fputs($File, $out);<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$makeFile = $buffer = &quot;&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;while ($buffer = fread($File,4096))<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$makeFile = $makeFile.$buffer;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fclose($File);<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;}<br/>}<br/>?&gt;</div><br/>使用方法：url("/userRpm/StatusRpm.htm?Disconnect=断%20线");<br/>断线后可以不连接，一般路由器会自动连接的。当然你也可以控制连接，就是把断线改成连接，不过每个路由器的连接可能会有些不同，请自行查找路由器正确的连接URL。<br/>Tags - <a href="tag.php?tag=php" rel="tag">php</a> , <a href="tag.php?tag=%E8%B7%AF%E7%94%B1%E5%99%A8" rel="tag">路由器</a> , <a href="tag.php?tag=%E8%87%AA%E5%8A%A8%E6%8D%A2ip" rel="tag">自动换ip</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?35&amp;guid=0#topreply</link>
<title><![CDATA[[评论] PHP控制路由器自动换IP]]></title> 
<author>aaa &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 15 Jan 2008 02:19:18 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?35&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	url(&quot;/userRpm/StatusRpm.htm?Disconnect=断%20线&quot;);菜鸟这句看不懂。<br/>保存成网页？？是自动断自动连接吗？有比对IP功能不？
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?35&amp;guid=1#topreply</link>
<title><![CDATA[[评论] PHP控制路由器自动换IP]]></title> 
<author>123 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 26 Jan 2009 11:04:15 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?35&amp;guid=1#topreply</guid> 
<description>
<![CDATA[ 
	什么呀，看不懂，想用路由器自动换IP能实现吗，请教一下，应该怎么换啊，帮帮我吧，谢谢！QQ：767237241
]]>
</description>
</item>
</channel>
</rss>