简体   繁体   中英

CGI Authentication via PHP script?

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.

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

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

$url = "http://$user:$password@adress.com/admin.cgi?mode=viewxml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM