jp15 Posted February 26, 2010 Share Posted February 26, 2010 Over to the experts, I have spent a while trying to produce customize some code, this is what it does so far. Displays files from the "uploads" directory in a drop down list. Uses java script to remove a value from the list. What I would like to be able to do and I need to no if its "doable" is; - make the links to files active (so the file will open when selected, maybe with the aid of a button would be nice) - once a user has removed a value from the list, to remove the file from the "uploads" directory and no just the list. Is this possible, if not, are there other ways to achieve this. Appreciate your help guys. Code: <?php $dir = opendir('location'); echo '<select id="mySelect">'; while ($read = readdir($dir)) { if ($read!='.' && $read!='..') { echo '<option> <a href="files/'.$read.'">'.$read.'</a></option>'; } } echo '</select>'; closedir($dir); ?> <input type="button" onclick="formAction()" value="Delete"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/193449-help-with-dynamic-drop-down-list-please/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.