[英]CGI Authentication via PHP script?
I'm trying to find out if there is any way to auth into some CGI script. 我试图找出是否有任何方法可以对某些CGI脚本进行身份验证。 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. 我希望我的脚本获取位于adress.com/admin.cgi?mode=viewxml
XML,但是需要用户身份验证,因此网站会在HTTP身份验证窗口中提示我,并且在我输入凭据时可以看到提到的页面,因此我可以轻松地使用XML。
Use this syntax: http://user:password@hostname/path
. 使用以下语法: http://user:password@hostname/path
。
$user = 'Stackoverflow';
$password = 'Password';
$url = "http://$user:$password@adress.com/admin.cgi?mode=viewxml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.