Setting login credentials for htaccess with php

Hi everyone,
I have had a heck of a time working on this problem so I thought I would ask it here:

I have a directory that is password protected through an htaccess file.

The directory holds a bunch of image files & flvs.

Our web app allows people to login to the system via a simple php/mysql script

Once they are logged in, I want them to be able to access the files in the protected directory.

I know how to view the images with a php_proxy script, But I can’t figure out how to get the JW player to play the flv’s.

I was wondering if there is a way for php to tell the htaccess file the username and password for the htaccess file so that the restriction is lifted and we can play the flv’s for that user.

Any insight would be great, Thanks

I’m not very familiar with htaccess or apache configuration behind some rewrites. With that said, the way I would approach the issue is to create a script that serves up the files from a accessible entry point for authenticated users.

I can do it with the image files, but the combination of doing with a flash object calling the protected flv is not working for me at all.

Are the correct headers being used for the flv files?

Here is what I am using:
header(‘Content-type: video/x-flv’);