Implementing proxies into php script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
maqeulek
Forum Newbie
Posts: 2
Joined: Fri Jan 25, 2008 4:20 am

Implementing proxies into php script

Post by maqeulek »

Hello,

I'm trying to implement proxies into my script that sends search requests to yahoo. First I just want to be able to implement a proxy to this simple script:

Code: Select all

 
<?php
//implement proxy
 
    $cUrl = curl_init();
    
            curl_setopt($cUrl, CURLOPT_URL, "http://search.yahoo.com");
            curl_setopt($cUrl, CURLOPT_HTTPPROXYTUNNEL, 1);
            curl_setopt($cUrl, CURLOPT_PROXY, '210.22.158.132:8080');
            
    curl_exec($cUrl);
    curl_close($cUrl);
?>
 
I can't get this to work, am I missing something? Please help.
Post Reply