views:

139

answers:

2

Simple question for the one who knows the answer...

$xml = simplexml_load_file("http://url/path/file.xml");

This url is .htaccess protected, how can I pass the login/password as arguments to the function?

A: 

file_get_contents or curl will allow you to set the user authentication. take the string data and pass into simplexml_load_string.

MANCHUCK
+2  A: 
$xml = simplexml_load_file("http://username:password@url/path/file.xml");

Try that :)

Phliplip
Cool thanks I'm just dumb! ^_^
Piero