View Single Post
Old 09-25-2007, 10:49 AM   #4 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Not sure what you're trying to do but how about something like this:

PHP Code:
<?php
    
    
function file_get_contents_proxy($szURL$szProxy$iProxyPort 8080)
    {
        
$pCurl curl_init($szURL);
        
        
curl_setopt($pCurlCURLOPT_PROXY$szProxy);
        
curl_setopt($pCurlCURLOPT_PROXYPORT8080);
        
        
curl_setopt($pCurlCURLOPT_FOLLOWLOCATIONtrue);
        
curl_setopt($pCurlCURLOPT_RETURNTRANSFERtrue);
        
        return 
curl_exec($pCurl);
    }
    
    
    
$aServers = array    (
                            array    (
                                        
'ServerAddr' => 'http://www.deli.icio.us/1/',
                                        
'ProxyAddr' => '192.17.239.250',
                                        
'ProxyPort' => 3127,
                                    ),
                                    
                            array    (
                                        
'ServerAddr' => 'http://www.deli.icio.us//2/',
                                        
'ProxyAddr' => '192.168.0.1:8080',
                                        
'ProxyPort' => 8080,
                                    )
                        );
                        
    for(
$iIndex 0$iIndex count($aServers); $iIndex++)
    {
        
file_get_contents_proxy($aServers[$iIndex]['ServerAddr'], $aServers[$iIndex]['ProxyAddr'], $aServers[$iIndex]['ProxyPort']);
    }

?>
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote