php unlink script for 100 credits!!!

Status
Not open for further replies.

nahsorhseda

Member
Messages
116
Reaction score
0
Points
16
can any one make me a directory delete script which has files but no folders in it
to be more precise i want to delete it from a html form like this one below
<form action=samepage.php method=post>
<input type=text name=input>
<input type=submit name=delete>
</form>
so when i hit the submit button i want the directory to be deleted of which i have typed the name in the input box.
and one more thing all the dirs. r in the root and the script also must be in the root
please help this poor girl out iam also paying you 100 credits!!
 
Last edited:

supajason

Member
Messages
288
Reaction score
2
Points
18
here you go....


PHP:
<?php

if(isset($_POST['delete']))
{
$input = $_POST['input'];

   $dir_delete = './' . $input;
   
   if (rmdir ($dir_delete)) {
         echo "Directory deleted successfully." . "<br />";
	 echo "<a href=" . $PHP_SELF . ">Back</a>";
   }else {
         echo "Could not delete the directory." . "<br />";
	 echo "<a href=" . $PHP_SELF . ">Back</a>";
   }

}
else
{
?>
<form action="<?php $PHP_SELF ?>" method="post">
<input type="text" name="input">
<input type="submit" name="delete">
</form>
<?php
}
?>
 

nahsorhseda

Member
Messages
116
Reaction score
0
Points
16
how can you be so foolish i already told you that the directory has files in it .the directory isnt empty.so you need to empty the directory before you can remove it.

please make that script for me!!
Edit:
ok i got it
i got it from php.net/unlink
 
Last edited:
Status
Not open for further replies.
Top