How can I stop my xml loading every time my index.php (template page) loads except the first time?
I am using my index.php page as a template that refreshes and shows different data depending on $_GET['']; values and some xml data. I want to load the xml into a varaiable the first time the page loads but not every time. Below is my code.
session_start();
$load_xml = true;
if($load_xml){
$xml = simplexml_load_file('PosterData.xml');
$load_xml = false;
$_SESSION['xmlData'] = $xml;
}
Probably with the above code is $load_xml will never be false. Any ideas how I can accomplish this?
1 Answer