Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP not receiving values for radio buttons
    primarykey
    data
    text
    <p>I'm using a PHP webpage to give me a list of all files with a .264 extension in a specific folder. The file is then selected and sent to a command to playback the video on a display attached to the computer.</p> <p>I'm having difficulties trying to get the radio buttons to maintain their values, so that when they are selected and the form button is pressed, they do not know their values and are therefore not able to execute the script.</p> <p>I know the script works, because I tested it with just a fill-in-the-blank type form and had no problems.</p> <p>Now I'm listing the files with a radio button to select the file and submit it to the form to play, but it isn't working as I had hoped.</p> <p>I've looked around and tried to figure it out. I'm not sure if I need to use a linked list or something instead of an array. This is my first time doing php coding, so I'm not sure where I should start to try to resolve this.</p> <pre><code>&lt;?php $FileCount = 0; $currentdir = '/data/'; //Location of Hard Drive $dir = opendir($currentdir); $array = array(); echo '&lt;ul&gt;'; while ($File = readdir($dir)){ //if (is_file($file)) $ext = pathinfo($File, PATHINFO_EXTENSION); if ($ext == '264'){ $array[] = "$File"; echo "&lt;INPUT class='radio' type='radio' name='FileName' value='$File' /&gt; &lt;span&gt;$File&lt;/span&gt;&lt;p&gt;"; $FileCount++; } } echo '&lt;form action="test.php" method = "post"&gt;'; echo "&lt;INPUT TYPE = 'Submit' name = 'FormSubmit' value = 'Submit'&gt;"; echo '&lt;/form&gt;'; if ($_POST['FormSubmit'] == "Submit") { echo $_POST["FileName"]; } </code></pre> <p>Nothing returns with this code. Any help would be great. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload