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 Quote 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){ Quote Link to comment https://forums.phpfreaks.com/topic/107714-solved-delete-script-help/#findComment-552201 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.