Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过PHP脚本进行CGI身份验证?_Php_Authentication_Http Authentication - Fatal编程技术网

通过PHP脚本进行CGI身份验证?

通过PHP脚本进行CGI身份验证?,php,authentication,http-authentication,Php,Authentication,Http Authentication,我试图找出是否有任何方法可以授权到某个CGI脚本中。我想让我的脚本获取位于address.com/admin.cgi?mode=viewxml上的XML,但需要用户身份验证,所以网站会用HTTP身份验证窗口提示我,当我输入所提到的凭据时,页面是可查看的,所以我可以轻松使用XML。使用以下语法:http://user:password@主机名/路径 $user = 'Stackoverflow'; $password = 'Password'; $url = "http://$user:$pas

我试图找出是否有任何方法可以授权到某个CGI脚本中。我想让我的脚本获取位于
address.com/admin.cgi?mode=viewxml
上的XML,但需要用户身份验证,所以网站会用HTTP身份验证窗口提示我,当我输入所提到的凭据时,页面是可查看的,所以我可以轻松使用XML。

使用以下语法:
http://user:password@主机名/路径

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

$url = "http://$user:$password@adress.com/admin.cgi?mode=viewxml
可能重复的