0
$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);

给我:

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

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

4

2 回答 2

2

您可以尝试像这样输入内联用户名和密码:

http://username:password@dev.yoursite.com/website/?post_type=tab_content&p=424&_parent_id=92&_page_id=110

这应该适用于基本的http身份验证

于 2012-07-31T15:34:18.127 回答
2

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

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

于 2012-07-31T15:34:23.740 回答