I have my flash setup so that it stores information in an XML file. It grabs the current XML file and then appends the new data to the end of the XML file. It does this by using the short PHP file below:
PHP Code:
<?php
if (isset($GLOBALS["HTTP_RAW_POST_DATA"])){
// $xml = xmldoc($GLOBALS["HTTP_RAW_POST_DATA"]);
$xml = $GLOBALS["HTTP_RAW_POST_DATA"];
$file = fopen("data.xml","wb");
fwrite($file, $xml);
fclose($file);
// echo("<status>File saved.</status>");
echo($GLOBALS["HTTP_RAW_POST_DATA"]);
}
?>
The problem is that I want to make it so people can't just go and grab the data.xml file. How do I protect the data.xml file so that no one can access it unless it is accessed via the Flash?
I have tried messing with some .htaccess settings but can't seem to get it to work. I was thinking I could create some kind of .htaccess setting so that the data.xml file would be password protected and only the swf and php file could have access to it. Is that possible? Is there a better way?
Thanks!