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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -