Jump to content

[SOLVED] File managment system


zipp

Recommended Posts

Im trying to make a File managment system, I have gotten the files to display properly, now what I am trying to do is have a check box next to each file, that if clicked, when the form is submitted, the file will be deleted. I would like to be able to have more then 1 check box selected.

 

html code (generated by php)

<form enctype='multipart/form-data' method='POST' id='del' action='delete.php'>
<input type='submit' value='Delete'></th>
                <tr><td colspan="2"><a href="/admin/admin-xxky.php?dir=upload/jackie">jackie</a></td>
                </tr>
                <tr>
                    <td>-->aloud.wav</td>

				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr>
                    <td>-->howto.txt</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr>
                    <td>-->readme.txt</td>

				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr><td colspan="2"><a href="/admin/admin-xxky.php?dir=upload/test2">test2</a></td>
                </tr>
                <tr>
                    <td>-->New Text Document.txt</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>

                <tr><td colspan="2"><a href="/admin/admin-xxky.php?dir=upload/test">test</a></td>
                </tr>
                <tr>
                    <td>-->New Flash ActionScript File.as</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr>
                    <td>-->New WinRAR ZIP archive.zip</td>

				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr><td colspan="2"><a href="/admin/admin-xxky.php?dir=upload/tom">tom</a></td>
                </tr>
                <tr>
                    <td>-->aloud.wav</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>

                <tr>
                    <td>-->howto.txt</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr>
                <tr>
                    <td>-->readme.txt</td>
				<td style="padding-left:40px;"><input type="checkbox" name="delete"></td>
                </tr></table>

 

 

 

delete.php code

<?php
if ($_REQUEST['delete']) {
unlink($_REQUEST['delete']);
}
?>

 

Link to comment
Share on other sites

I thought that REQUEST was more secure then POST.  :P thanks for the tip.

 

As soon as I try the delete[] thing, ill edit my post accordingly.

 

**edit**

Thank you for your help, both responses where helpful.

 

Topic solved.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.