Page 1 of 1

Protecting flash component

Posted: Thu Sep 20, 2007 6:43 pm
by Shendemiar
I have a site with php/session/user type security.

I added one nice flash component, but i cannot prevent unlogged users from running it (if they know the url) unless i place it under htaccess protected folder. If i do that it would require for the logged users to enter a different password if they wanted to access that file, even they are logged-in already.

Is there a way to grant certain sessions access to htaccess protected folder by php and how?

Posted: Thu Sep 20, 2007 8:47 pm
by mrkite
You could have a PHP wrapper script.

It checks the credentials and if they check out, does the following:

Code: Select all

header("Content-Type: application/x-shockwave-flash");
readfile("/path/to/your/flash.swf");
Then on the page you would point to the php script instead of the swf in the object tag. You can even make a "invalid password" flash to display to people who fail credentials.