basically i have created a selection box which display the files i have got in a certain folder which are xml files, my problem is that i am unsure how to save the content of the file selected as a live variable which changes on different selected which the variable can be called to show a table.
here my code so far;
<?php
$dir = opendir("C:/xampp/htdocs/xml");
//List files in images directory
while (($file = readdir($dir)) !== false)
{
$last4 = substr($file, -4);
if ($last4 == ".xml")
{
$files[] = $file;
}
}
closedir($dir);
printf ('<select>');
foreach($files as $let => $val){
printf ('<option value="'.$let.'">'.$val.'</option>');
}
printf ('</select>');
?>