| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | $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 Join Date: Jan 2006
Posts: 1,130
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 Join Date: Jan 2006
Posts: 1,130
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Add at top of the filoe: Code: $type = array("gif", "jpg", "bmp"); Replace Code: if (strtolower(substr($entryName, -3)) == "jpg") ????: NamePros.com http://www.namepros.com/showthread.php?t=232655 Code: if (in_array(strtolower(substr($entryName, -3)), $type) )
__________________ |
| |