[SOLVED] Sending username and password to another page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
skeptikal
Forum Newbie
Posts: 10
Joined: Mon Dec 22, 2003 5:55 pm

Sending username and password to another page

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds like a job for [php_man]curl[/php_man]! :lol: sometimes I have too much fun. :)
skeptikal
Forum Newbie
Posts: 10
Joined: Mon Dec 22, 2003 5:55 pm

Post 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
Post Reply