<?php
//    return a parameter file for a session   (todo=6)

require("phpVars.php");


  $afile='';
  $aname='';
  foreach ($_GET as $vname=>$oof) {
     $avar=trim(strtoupper($vname)) ;
     if ($avar=='FILE') $afile=trim($oof) ;
     if ($avar=='NAME' || $avar=='SESSION') $aname=trim($oof);
  }

if ($afile=='' || $aname=='') {
  print '<h3>Sorry</h3>No NAME or SESSION=, or no FILE= argument, in call to   returnSessParams.php ';
  print '<p><a target="_top" href="/dsurvey/admin.htm">Return to survey admin page</a>';
  exit ;
}

if (strpos($afile,'.')===false) $afile= $afile . '.XML';

$dafile=$sessions_dir . $aname . '/' . $afile    ;

$isfile=file_exists($dafile);
if (!$isfile) {
  print "<h3>Sorry</h3>No such parameter  file $dafile  (returnSessParams.php) ";
  print '<p><a target="_top" href="/dsurvey/admin.htm">Return to survey admin page</a>';
  exit ;
}

$stuff=file_get_contents($dafile);

header('Content-Type: text/xml; charset=iso-8859-1');
echo $stuff;
exit;


?>

