View Single Post
  #8 (permalink)  
Old 10-07-09, 01:41 PM
sac0o01 sac0o01 is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Still getting this:

Warning: Cannot modify header information - headers already sent by (output started at /home2/freefor3/public_html/bannerv2/images_saved/delete.php:1) in /home2/freefor3/public_html/bannerv2/images_saved/delete.php on line 12

Here is what I have so far:

view.php
PHP Code:

<?php

$path
='./'// change the path here related to this page
$handle=opendir($path);

while ((
$file readdir($handle))!==false) {
if (
is_file($file)) { echo "

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

"
;}


}
closedir($handle);
?>
and delete.php
PHP Code:

<?php

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

$PathFIle=$path.$Name;

$PathFile basename($PathFile); 

if (
is_file($PathFile)) 
    
unlink($PathFile);  

header('Location: view.php');
?>
Reply With Quote