ok, so i am trying to make it so the user can click on the image and remove the specific image from the gallery. right now it works to remove the thumbnail, but i need it to remove the large image too. is it possible to do this? here is the code for the image link.PHP Code:<?
/************************************************************
* Setup variables
************************************************************/
$site_name = $_SERVER['HTTP_HOST'];
$upload_dir = "../images/gallery/photos/thumbnails/";
$upload_dir2 = "../images/gallery/photos/";
$message ="";
/************************************************************
* List Files
************************************************************/
$handle=opendir($upload_dir);
$filelist = "";
while ($file = readdir($handle)) {
if(!is_dir($file) && !is_link($file) && substr($file, -4, 4) == ".jpg") {
$filelist.="<a href='?del=$upload_dir$file&&?del=$upload_dir2$file' title='delete'><img src='".$upload_dir."".$file."' border='0'></a>";
$filelist.=" ";
}
}
/************************************************************
* Process User's Request
************************************************************/
if ($_REQUEST[del]) {
unlink($_REQUEST[del]);
print "<script>window.location.href='?message=deleted successfully'</script>";
}
/************************************************************/
?>
<div align="left"><font color=red><?=$_REQUEST[message]?></font>
<br>
<br>
<b>Gallery Images</b>
</div>
<hr align="left" width=70%>
<div align="left">Click the thumbnail to delete an image<br/>
<br/>
<strong><font color="#FF0000">WARNING!</font></strong><br/>
Do NOT Click a on any image, unless your ABSOLUTELY CERTAIN that you wish to remove the file.<br/>
<br/>
<?=$filelist?>
</div>
as you can see, i am calling $upload_dir$file and then trying to call the second path in the same link with &&?del=$upload_dir2$file. So, like i was saying, it removes the thumbnail, but i need it to remove the large image too. please help. let me know if this is possible, or do i need to just call the delete function with the link to remove the thumbnail, and then somehow tell it to go to a second function and remove the same file name from the second location? thanks in advance to anyone that can help.PHP Code:$filelist.="<a href='?del=$upload_dir$file&&?del=$upload_dir2$file' title='delete'><img src='".$upload_dir."".$file."' border='0'></a>";
p.s. the reason i posted the entire code is so that you can go back and see what functions are being called to make this all work, not to have you code something for me. see what you guys/gal can do. thanks again.



Reply With Quote
Bookmarks