with this script you can connect to any website using proxy server: and it can be used as alternative way for using: file(),file_get_contents(),fopen(),simpleXMLElement(),... to connect to a specific url , if these functions are disabled on the host server , or you have to use proxy to reach an url. the function fetch_content() return the url as sting so you can handle it as you like, and i just output it in this script. enjoy it <form action="digitalpoint_1.php" method="post"> <input type="text" name="url" value="Enter your url here" size="50" > <input type="text" name="url_proxy" value="Enter your url proxy here" size="50"> <input type="text" name="port_proxy" value="Enter your proxy port here" size="50"> <input type="submit" value="Connect"> </form> HTML: <?php function fetch_content($URL,$url_proxy,$port_proxy) { $ch = curl_init(); curl_setopt ( $ch, CURLOPT_URL, $URL ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_PROXY, $url_proxy); curl_setopt($ch, CURLOPT_PROXYPORT, $port_proxy); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); $data=curl_exec($ch); return $data; curl_close($ch); } echo fetch_content($_POST["url"],$_POST["url_proxy"],$_POST["port_proxy"]); ?> PHP:
case 'HTTP': curl_setopt($cUrl, CURLOPT_PROXY, $Proxy); curl_setopt($cUrl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); PHP: case 'Socks4': curl_setopt($cUrl, CURLOPT_PROXY, $Proxy); curl_setopt($cUrl, CURLOPT_PROXYTYPE, 4); PHP: case 'Socks5': curl_setopt($cUrl, CURLOPT_PROXY, $Proxy); curl_setopt($cUrl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); PHP: