| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Account Closed | $3 for quick help! Hi I need help right now, i have a directory full of images that have been uploaded by users, (this use's no mysql) so what i am making is a dmincp that will list all the images in view/ directory and then next to the image there is a button that will say delete so when i click on that button the image file is delted from view/ directory i have this so far. PHP Code: Thanks |
| |
| | #2 (permalink) |
| Senior Member | Modify this: Code: echo '<img src=' .$read.$entryName. '> <a href="delete.php">Delete</a><BR>'; Code: echo '<img src=' .$read.$entryName. '> <a href="delete.php?name=$entryName">Delete</a><BR>'; Code: <?php
$read = '../view/';
if(!empty($_GET["name"]))
{
$file = $read . $_GET["name"];
if(unlink($file))
echo "Done";
else
echo "Error";
}
?>
|
| |
| | #6 (permalink) |
| Senior Member | Add at top of the filoe: Code: $type = array("gif", "jpg", "bmp");
Replace Code: if (strtolower(substr($entryName, -3)) == "jpg") Code: if (in_array(strtolower(substr($entryName, -3)), $type) ) |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |