View Single Post
Old 03-09-2009, 01:53 PM   #62 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by sketchMedia View Post
An alternative to using curl would be:
PHP Code:
/* $ch = curl_init();
 curl_setopt ($ch, CURLOPT_URL, $url);
 curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
 curl_setopt ($ch, CURLOPT_USERAGENT,  self::BROWSER);

 $url_string = curl_exec($ch);
 curl_close($ch);*/
$opts = array(
    
'http'=>array(
        
'method'=>"GET",
        
'header'=>"User-Agent: ".self::BROWSER." \r\n"
    
)
);
$url_string file_get_contents($url,false,stream_context_create($opts));
return 
simplexml_load_string($url_string); 
But stream context create doesn't work on secured pages, such as for example the guild-login part or the account management page?

Or am I wrong?
__________________
Tanax is offline  
Reply With Quote