# Remote HTTP Authentication via PHP



## agusgriego (May 5, 2004)

Hi!! I want to know if this is possible.

I need to show in one page the content of other pages located in different servers that require HTTP Authentication without prompting the user to put the different passwords.

Is it possible to authenticate with the remote servers via php, grab the information and show it to the user?

Thanks in advance,


----------



## rhg (May 6, 2004)

Yes, this is possible. It is all about HTTP headers. You must transmit an appropriate Authorization header.

Reference:
http://frontier.userland.com/stories/storyReader$2159


----------



## anime_layer (May 6, 2004)

Should be. There are two ways I can think of:
Use fopen ('http://user:upass@website/page.html','r') to open a file remotely and then pass the data to the user.
The second was is just set the links with user/pass in the url.

First method is more secure but increases server load since it has to load all the pages from other servers. With the second method the user will do this but the login/pass will be visible and can easly leak by c&p.


----------

