I want to access a file that is on a server that has an SSL certificate as well as a username/password auth and save it to a string. This is what I'm trying:
$site = "https://user:pass@hostname";$xml_page = file_get_contents($site);echo $xml_page;
3/9/2009 5:08:01 PM
do you have libcurl installed?http://blog.taragana.com/index.php/archive/how-to-use-curl-in-php-for-authentication-and-ssl-communication/
3/9/2009 5:33:13 PM
have you tried using cURL?[Edited on March 9, 2009 at 5:35 PM. Reason : philihp beat me to it; http://us3.php.net/curl anyway]
3/9/2009 5:34:05 PM
open up a phpinfo() and see what allow_url_fopen is set to. If its set to 0 then it should disable opening a remote URL with file_get_contentsyou may be able to override it with php_admin_value
3/9/2009 5:45:01 PM
I got it working with curl. However, I'm having a problem parsing a string containing xml code that is formatted the following way:
<?xml ...><GetColorList><ColorList><Color Name="Red" IsDefined="0" IsPresent="1"><Color Name="Blue" IsDefined="0" IsPresent="0"><Color Name="Green" IsDefined="0" IsPresent="1"></ColorList></GetColorList>
Red 1Blue 0Green 1
3/16/2009 12:11:11 PM
3/16/2009 12:13:51 PM
Anything in particular that might work in PHP4?
3/16/2009 2:21:53 PM
http://us2.php.net/manual/en/function.domattribute-value.php
3/16/2009 2:24:17 PM