Re: http authentication and php
| From: | Evan Nemerson | Date: | Sun, 23 Sep 2001 06:41:09 +0000 |
| Subject: | Re: http authentication and php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68400@lists.php.net to get a copy of this message | ||
if you just want to output the file to the user,
readfile("http://server.com/greendocks/locked/useradd.htm?user=blah&pass=blah");
should work. If you want to play with the file first, file() will put it in
an array, fopen() will create a file pointer to it, you could create your
very own HTTP session (if you know the protocol) with fsockopen()... i'm sure
there are more, but that's all you need (probably). I would probably use this:
$file=implode("\n",file("http://server.com/greendocks/locked/useradd.htm?user=blah&pass=blah"));
if i wanted to place the whole thing in one variable, not an array.
On Saturday 22 September 2001 20:39, you wrote:
> I am trying to write a php script that will work around a http
> authentication that I do have access to. I am trying to do this so that a
> form process in my control panel can automatically have information sent to
> it from a form that a user will fill out. However, my problem is in trying
> to get PHP to automatically authenticate.
>
>
> for example: I want to be able to call a url like this:
>
> http://server.com/greendocks/locked/useradd.htm?user=blah&pass=blah
> but
> this url is behind a http authentication. Is it possible to have this url
> called by a php script?
>
> And the second part of the question is can I do this process so it is
> completely invisible to the user that this page has been called? Because of
> course I don't want to allow users to have access to everything in my
> control panel.
>
> Hopefully someone knows what I'm getting at. Thanks for any help you may be
> able to provide.
>
> Jeff