Protection for reading files dynamically
<p>What's the best way to protect against dynamic file access using URL variables? I'm concatenating two URL variables that will form the filename I want to access which will load XML.</p>

<pre><code>$type = $_REQUEST['type']
//(ie. AB);
$timeframe = $_REQUEST['timeframe']
//(ie. 00.04);

//create XML document object model (DOM)
$main_doc = new DOMDocument();
$s = SITE_DIR."/data/file.".$type.".".$timeframe.".xml"; 
// example file.AB.00.04.xml)
// will be adding test to see if file exists
$main_doc-&gt;load($s);
</code></pre>
