I am trying to include html file that resides on other server than the
main .php file (landing.php), while this server requires user
name-password authentication. I tried 2 options while trying:
<?
if ($page=="24") {
include ("http://10.11.0.251/support/index.html");
}
else {
include ("http://10.11.0.251/support/faq.html");
}
?>
replies me, in the place where the included content suppose to be, the
warnings:
Warning: main(http://10.11.0.251/support/faq.html): failed to open
stream: HTTP request failed! HTTP/1.1 401 Authorization Required in
/www/landing.php on line 242
Warning: main(): Failed opening 'http://10.11.0.251/support/faq.html'
for inclusion (include_path='.:/home/httpd:/usr/share/php') in
/www/landing.php on line 242
and when trying the following:
<?
if ($page=="24") {
@include("http://10.11.0.251/suppport/csb.html");
}
else {
@include("http://10.11.0.251/suppport/csb.html");
}
?>
it replies nothing just like ignore the inclusion, the rest of the
page is diplayed OK, while in the place where the included content
suppose to be - it is empty.
summarizing, non of the ways works.
can someone please help me: what is the right way for including pages
from remote protected server?
Thanks a lot