designedfree4u Posted May 28, 2008 Share Posted May 28, 2008 Trying to specify a certain contents to delete in a specific dir. I tryed but no worky. tryed this: foreach(glob('uploads/') as $file){ original code displays everthing in the public_html/ <?php if(isset($_POST['submit'])){ unlink($_POST['file']); echo $_POST['file'].' deleted'; } ?> <form action="<?php echo $_SERVER['phpself']; ?>" method="POST" /> <?php echo '<select name="file">'; foreach(glob('*.*') as $file){ echo '<option value="'.$file.'">'.$file.'</option>'."\n"; } echo '</select>'; ?> <input type="submit" name="submit" value="Delete!" </form> Thank you Link to comment https://forums.phpfreaks.com/topic/107714-solved-delete-script-help/ Share on other sites More sharing options...
designedfree4u Posted May 28, 2008 Author Share Posted May 28, 2008 Yes! Solved it using: http://us3.php.net/glob foreach(glob("uploads/*.jpg") insted of foreach(glob('uploads/') as $file){ Link to comment https://forums.phpfreaks.com/topic/107714-solved-delete-script-help/#findComment-552201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.