View Single Post
  #5 (permalink)  
Old 10-07-09, 08:56 AM
ruteckycs's Avatar
ruteckycs ruteckycs is offline
Coding Addict
 
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
2 scripts for this:

save as view.php
PHP Code:

<?php
$path
='images/';// change the path here related to this page
$handle=opendir($path);

while ((
$file readdir($handle))!==false) {
if(
strlen($file>3)){echo "

<img src=
$path$file> <br>
<form action=\"delete.php\" method=\"post\">
<input type=\"hidden\" name=\"Name\" value=\"
$pathfile\">
<input type=\"submit\" value=\"Delete\">
</form>

"
;}


}
closedir($handle);
?>
save as delete.php

PHP Code:

<?php
$path
='images/';// change the path here where images are
$Name=$_POST['Name'];

$PathFIle=$path.$Name;

unlink('$PathFile');

header('Location: view.php');
?>
There isnt any styling for the output, there is no security .. you can add these things yourself.Make sure you edit the path section the the directory where your images are. This code is untested but should be fine.
__________________
This post was created with 100% recycled electrons.
Reply With Quote