php - load xml file with authentication (and improving security) -
i'm trying use simplexml load xml file server:
$xml = simplexml_load_file($xml_query);
the server needs http authentication, (unsurprisingly) error message:
http request failed! http/1.1 401 unauthorized
is possible pass username , password server using function?
edit
if can tell me more secure way this, i'd grateful.
you should able prepend username , password url you're opening. instead of
http://link.to/file.xml
try
http://username:password@link.to/file.xml
Comments
Post a Comment