Passing credentials on PHP redirect

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
AutoSear
Forum Newbie
Posts: 1
Joined: Mon Nov 11, 2002 10:09 am

Passing credentials on PHP redirect

Post by AutoSear »

First of all, great forum :)

As part of an anti-leeching scheme I'm working on, I'm trying to pass basic authentication credentials (for an .htaccess protected directory) on PHP redirect like follows:

Code: Select all

Header ("Location: http://username:password@www.domain.com/files_prot/file.txt");

It's not working, however. PHP (or Apache?) seems to be ignoring the credentials. When my browser is redirected, I'm presented with the authentication box. I've heard this works fine with an ASP redirect.

Does anyone have any ideas on how to get this to work?

Best Regards,
Auto
Post Reply