how to access xml file from a protected directory??
Posted: Sat Jul 04, 2009 8:15 am
Hello,
I have an xml file located at http://develop.leadapps.com/onlineradio ... unties.xml
I have written a php code which will print out all the content
The problem is that http://develop.leadapps.com/onlineradio ... Framework/ folder is password protected. So i will need to have to login using htaccess to get into the directory.
Here is the error output that i got
another way to do is to go for a curl execution and get the results as it is by using a user proxy.
But i am not sure.. Will try out. But please let me know if that can be done using curl execution and if so how??
Thanks in advance
I have an xml file located at http://develop.leadapps.com/onlineradio ... unties.xml
I have written a php code which will print out all the content
Code: Select all
$mybounties=simplexml_load_file("http://develop.leadapps.com/onlineradio1/supportFramework/bounties.xml");
echo $mybounties->asXML();
Here is the error output that i got
Code: Select all
Warning: simplexml_load_file(http://develop.leadapps.com/onlineradio ... unties.xml) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in D:\Dev\Apache Software Foundation\Apache2.2\htdocs\dummyproject\forumquestion.php on line 4
Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://develop.leadapps.com/onlineradio1/supportFramework/bounties.xml" in D:\Dev\Apache Software Foundation\Apache2.2\htdocs\dummyproject\forumquestion.php on line 4
Fatal error: Call to a member function asXML() on a non-object in D:\Dev\Apache Software Foundation\Apache2.2\htdocs\dummyproject\forumquestion.php on line 5
But i am not sure.. Will try out. But please let me know if that can be done using curl execution and if so how??
Thanks in advance