php使用htaccess密码创建url?

php使用htaccess密码创建url?,php,fread,http-status-code-401,Php,Fread,Http Status Code 401,给我: $handle = fopen(site_url() . "/?post_type=tab_content&p=$content_id&_parent_id=$parent_id&_page_id=$page_id", "r"); $contents = fread($handle, filesize($filename)); fclose($handle); 这是我可以用php绕过的吗?非常感谢-您可以尝试将内联用户名和

给我:

$handle = fopen(site_url() . "/?post_type=tab_content&p=$content_id&_parent_id=$parent_id&_page_id=$page_id", "r");
$contents = fread($handle, filesize($filename));
fclose($handle);

这是我可以用php绕过的吗?非常感谢-

您可以尝试将内联用户名和密码如下:

Warning: fopen(http://dev.yoursite.com/website/?post_type=tab_content&p=424&_parent_id=92&_page_id=110): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 82 Warning: fread() expects parameter 1 to be resource, boolean given in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 83 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 84

对于基本的http身份验证,这应该是可行的。您可以尝试将内联用户名和密码如下所示:

Warning: fopen(http://dev.yoursite.com/website/?post_type=tab_content&p=424&_parent_id=92&_page_id=110): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 82 Warning: fread() expects parameter 1 to be resource, boolean given in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 83 Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/domains/dev/website/wp-content/themes/insource/index.php on line 84

对于基本的http身份验证,这应该是有效的。您应该能够将用户名和密码作为URL字符串的一部分提供,就像FTP连接一样:


http://username:password@url.com/path/

您应该能够提供用户名和密码作为url字符串的一部分,就像FTP连接一样:


http://username:password@url.com/path/

查看@Fabio Nice链接。这绝对是一个好消息。谢谢查看@Fabio尼斯链接。这绝对是一个好消息。谢谢