Jump to content

need help with loading/reading remote xml with authentication


dylanm

Recommended Posts

Hello  all,

I am trying to read a remote xml file on a file server which requires username and password. I can access the xml file fine through HTTP authentication like

 

\\111.11.11.111\\pdrs\fileserver\FullText\12345\12345_CLEANUP.xml

 

But when i try to read it with PHP, I recieved a warning message:

"Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity"

 

allow_url_fopen is ON

This is part of my code.

 

       

$test=rawurldecode("http://username:password@\\\\111.11.11.111\\pdrs\\fileserver\\" . $number . "\\FullText\\" .  $number  . "_CLEANUP.xml");
echo $test;	
$xml_filename = simplexml_load_file(rawurldecode("($test)"));

echo $xml_filename;
print_r($xml_filename);

 

Am I missing something here? Is there any other way to read/save/load a remote xml file which requires authentications? I am new to php so any help is appreciated!

Thanks,

 

I don't understand what you were thinking with the $test but try

$xml_filename = simplexml_load_file("http://username:[email protected]/pdrs/fileserver/$number/FullText/$number_CLEANUP.xml");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.