Jump to content

[SOLVED] Delete script help


designedfree4u

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.