I've been searching for over 5 hours now and have found pleanty of info on PHP_AUTH_USER and PHP_AUTH_PW. What I need is the opposite and on the queries I found with my same problem there have not been any answers.
Here is the situation:
1) We have a PHP login page that queries against a MySQL table for a correct username and password pair for hundreds of users.
2) Once the user is authorized a link is returned to the browser for 1 of 2 different files. Let's say the user is a Silver Member they get a link for '/medals/silver.pdf'. If they are a Gold Member they get a link to '/medals/gold.pdf.'
3) All this is fine and works great. Please don't talk about the header() function because it doesn't work in all versions of IE. That is not the issue or problem.
4) We want to force the user to login each time to download the updated copies of the pdfs located in the /metals directory. Smart users would be able to save the link to the pdfs in their favorites or bookmarks. To thwart this and force them to login we have placed a .htaccess file in the /metals directory. That .htaccess file requires one user, "foo" with password "bar."
5) The idea was that if the user authenticated we could set the auth user and password to "foo" and "bar" and when they clicked on the link to retrieve the PDF it would authenticate automatically against the .htaccess file. But we can't find anywhere how to send the "foo" and "bar" values to the browser for the .htaccess file.
Does this make sense? As I've said above this question has been asked buy not answered here or on PHP.net or on any other list I've been able to find and search all day. If someone can help with this or provide an answer I will promptly distribute the solution to the other lists to help out those that have posted the same question but not yet received answers.
Thanks in advance for any help.
Would also appreciate if any help could be emailed directly to me as well as posted to the list. I'm fairly new to PHP. Can read and understand and modify existing code but can't quite construct from scratch yet. :-)
Thanks again,
-shane