PDA

View Full Version : client side flash accessing password protected directory?


horst van bongs
05-26-2005, 06:26 PM
forgive my relative ignorance, i feel like a midget in the company of giants here, but...

i'm building an xml driven flash photo viewer. so far so good on the photo viewer, i've gotten it to load remote jpgs and display and arrange them based on the xml.

i'd like to password protect the directory that the jpgs are in, so that they can't be accessed directly, only through the flash app. no need to get the password from the user, it could (and likely should) be hard-coded into the flash app. not too paranoid about security either. if some one is smart enough to hack my flash app to get to the photos, so be it.

any ideas? the simpler the better...

Xeef
05-26-2005, 06:51 PM
mayby whit PHP

if the file which try to access this php wasn't loaded from "YourDomain.com" the php terminat execution you not even need a password

$na = $_SERVER["SERVER_NAME"];
$na=substr($na,strlen($na)-14,14); // 14 is the length of "YourDomain.com"
if ($na<>"YourDomain.com"){
exit;
}