i have php page collects fileames folder , populates array array used create dropdown list. want submit value selected , display , thats stop. please help. in advance.
<?php // open directory $mydirectory = opendir("media/mp3_para"); // each entry while($entryname = readdir($mydirectory)) { $dirarray[] = $entryname; } // close directory closedir($mydirectory); // count elements in array $indexcount = count($dirarray); // sort 'em sort($dirarray); // create dropdown list echo "<form method='post' action='1.php' > " ; echo "change selection : " ; echo "<select name='my_select'>" ; foreach($dirarray $index) { // remove . or .. list if (substr("$index", 0, 1) != ".") { $titlname1=$index ; $name1=substr($titlname1,0,-4) ; $titlname1=$name1 ; echo '<option value="'.$index.'">'.$titlname1.'</option>' ; } } echo '</select>'; echo "<input type='submit' class='navlinks' " ; echo "</form>" ; echo my_select ; ?> </body>
Comments
Post a Comment