title: PHP Dynamic Radio Buttons and Submit Button
body: <p>I am trying to create a php file that would scan a directory, make a list of dynamic radio buttons and have the user select one and submit it and it shall pass it into another php file that would send it off, but I am having trouble with the submit button. Was wondering if I could get some answers, been looking around the net and haven't been able to find anything.
  Here is my code:</p>
  
  <pre><code>&lt;?php
  
  ini_set('display_errors',true);
  //Scan directory (ripped from another site)
  $directory = opendir("download");
  while($entry = readdir($directory)) {
      $dirArray[] = $entry;
  }
  closedir($directory);
  $indexCount = count($dirArray);
  sort($dirArray);
  
  //Make the Radio Button list
  $RList = "";
  for($i=2; $i&lt;count($dirArray); $i++) {
      $value = $dirArray[$i];
      $RList .= "&lt;input type=\"radio\" name=\"Files\" value=".$value." /&gt;".$value."&lt;br /&gt;";
  }
  //Submit button
  $RButton = '&lt;input type="button" value="Submit" 
  onclick="location.href=\'http://localhost/appClient/load.php?file='.$value.'\'"&gt;';
  echo $RList.$RButton;
  #echo $_POST["Files"];
  
  ?&gt;
  </code></pre>
  
  <p>Thanks</p>