Here's how it works: Flash sends data to PHP and PHP writes that data to an XML file.
Now what would be the best way to make sure that the XML's filesize doesn't grow too big?
Can I add some code to the PHP that checks the XML's filesize and creates a new XML file if it gets too big?
I don't know PHP that well so I need some help. I know that I could just do this by hand regularly on the server, but I want to know if there is some way to automate this process, so if there is any other way please let me know.
This is my simple PHP code, that writes the flash data to PHP:
Code: Select all
<?php
$filename = "xmldata/trackingData.xml";
$raw_xml = file_get_contents("php://input");
print $raw_xml;
$fp = fopen($filename, "w");
fwrite($fp, $raw_xml);
fclose($fp);
?>