Page 2 of 2

Posted: Thu Jul 21, 2005 4:11 pm
by dyonak

Code: Select all

echo $_POST['deletethese'];
	print_r ($_POST['deletethese']);
is directly below the form, above the if(issset) statement, and yields nothing.

Posted: Thu Jul 21, 2005 4:13 pm
by Burrito
let's see all the code...something is awry if neither of those show anything...

Posted: Thu Jul 21, 2005 4:18 pm
by dyonak
Incoming:

Code: Select all

<?php
echo '<form><table width ="100%">';
$count = 0;
foreach (glob("imagestest/*.jpg") as $filename) {

   echo "<td width='100'><a 

href='http://www.dustinyonak.net/$filename'><img 

src='$filename' width='80' height='60'></a><br />" . 

round(filesize($filename)/1024) . "KB <input type='checkbox' 

name='deletethese[]' value='$filename'></td>";
	$count ++;
	if($count==5){
        echo "</tr><tr>";
        $count = 0;
    }

}

echo '</table>';
echo '<input type="submit" name="delsubmit" value="Delete 

Selected Images">';
echo '</form>';

//Handle the deletion form
$count = 0;

	echo $_POST['deletethese'];
	print_r ($_POST['deletethese']);
if (isset($_POST['delsubmit'])) {
	$deletethese = $_POST['deletethese'];
	foreach($deletethese as $index=>$deletethis){
		$count ++;
	}

}
echo "$count images deleted.";
The rest of the code, below this, is the upload submission form/image resizing script. In the interest of readability I didn't include that stuff but if you want ALL of the pages code let me know and I will paste it.

Posted: Thu Jul 21, 2005 4:23 pm
by Burrito
try this:

Code: Select all

<?php
//Handle the deletion form
if(isset($_POST['deletethese'])){ 
    echo $_POST['deletethese'];
    print_r ($_POST['deletethese']);
}else
    echo "post vars not set yet";


echo '<form><table width ="100%">';
$count = 0;
foreach (glob("imagestest/*.jpg") as $filename) {
 
   echo "<td width='100'><a 
 
href='http://www.dustinyonak.net/$filename'><img 
 
src='$filename' width='80' height='60'></a><br />" . 
 
round(filesize($filename)/1024) . "KB <input type='checkbox' 
 
name='deletethese[]' value='$filename'></td>";
    $count ++;
    if($count==5){
        echo "</tr><tr>";
        $count = 0;
    }
 
}
 
echo '</table>';
echo '<input type="submit" name="delsubmit" value="Delete 
 
Selected Images">';
echo '</form>';

Posted: Thu Jul 21, 2005 4:35 pm
by dyonak
Just getting a whole lot of "post vars not set yet".

Here's the page with your code on it if you want to look. . .

Pic Manager

Posted: Thu Jul 21, 2005 4:37 pm
by Burrito
doh! you need to change your form method to "POST"...it is "GET" by default.

Posted: Thu Jul 21, 2005 4:37 pm
by pickle
call print_r($_POST) to see what IS being sent.

Posted: Thu Jul 21, 2005 5:00 pm
by dyonak
That was it Burrito :oops: I'm embarrased, sorry about that you guys haha, thanks so much for all your help.