including file that resides on server that requires authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Orit

    including file that resides on server that requires authentication

    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
  • nice.guy.nige

    #2
    Re: including file that resides on server that requires authentication

    While the city slept, Orit <Orit_Itzhar@at rica.com> feverishly typed:
    [color=blue]
    > 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:[/color]

    Just guessing, but could you put the username and password into the uri as
    in: http://username:password@www.whateve...e/whatever.php ?

    Like I say, just guessing...

    Hope that helps,
    Nige

    --
    Nigel Moss.

    Email address is not valid. nigel@nigenetDO G.org.uk. Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    In the land of the blind, the one-eyed man is very, very busy!


    Comment

    Working...