簡體   English   中英

PHP中的代理服務器

[英]Proxy server in php

我在firefox中使用代理服務器擴展來更改我的IP地址。

PHP中是否有任何腳本可以更改ip地址? 我在php中僅找到域更改腳本,而沒有與ip相關的腳本。 有任何建議請。

使用curl可以做到這一點...請嘗試以下一種方法:

    <?php

         $proxy = "xx.xx.xx.xx:xx";
         $proxy = explode(':', $proxy);
         $url = "http://www.google.com";

         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_PROXY, $proxy[0]);
         curl_setopt($ch, CURLOPT_PROXYPORT, $proxy[1]);
         curl_setopt($ch, CURLOPT_HEADER, 1);
         $exec = curl_exec($ch);

  ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM