Page 1 of 1

Sending username and password to another page

Posted: Fri Aug 13, 2004 12:41 am
by skeptikal
Hi there everyone...
Here's a little question:

Is there a way to make my page send the HTTP username and password to another page using HTTP Authentication? I think I can be clearer with an example, so here goes... Suppose I have some files protected by HTTP authentication in domain A... now say I have a script in domain B that wants to access those files. I have the necessary login info, but I don't know how to pass these to domain A's server to make my presence acceptable...

I looked and looked, but all I find is related to HTTP authentication with PHP (implementing such system on your page) and not actually loggin in another page...

So, any ideas? Did I make myself clear or not?

Thanks and best regards,

Skeptikal

Posted: Fri Aug 13, 2004 1:06 am
by feyd
sounds like a job for [php_man]curl[/php_man]! :lol: sometimes I have too much fun. :)

Posted: Fri Aug 13, 2004 6:24 pm
by skeptikal
Thanks for the help, feyd, that really looks helpful...

However I found a very simple solution for this problem. It's a bit ugly but it will do the trick ;) I just included the username and password on the request to the page, like this:

Code: Select all

http://username:password@www.domain.com
I know it could be a lot better, but since this is a "personal" script it will be of great help :)

Thanks again, and consider this one solved ;)

Regards,

skeptikal