0

I'm trying to find out if there is any way to auth into some CGI script. I want my script to fetch XML located over adress.com/admin.cgi?mode=viewxml but user auth is required, so website prompts me with HTTP Auth window and when I enter credentials mentioned page is viewable, so I can easily work with XML.

Darj
  • 1,403
  • 1
  • 17
  • 47
  • possible duplicate of [How do I make a request using HTTP basic authentication with PHP curl?](http://stackoverflow.com/questions/2140419/how-do-i-make-a-request-using-http-basic-authentication-with-php-curl) – Jan Hančič Nov 07 '11 at 13:30

1 Answers1

0

Use this syntax: http://user:password@hostname/path.

$user = 'Stackoverflow';
$password = 'Password';

$url = "http://$user:$password@adress.com/admin.cgi?mode=viewxml
ComFreek
  • 29,044
  • 18
  • 104
  • 156