OK, i'm making a forum, and i'd like to allow myself and moderators to delete multiple posts at a time, using checkboxes.
First I thought making the checkbox name the post subject, or the post ID. However that wou;dn't work 'cause then i'd need to know the ID ect ect and create a whole bunch of problems. Does anyone have an idea as to how I can do this?
Thanks in advance,
Unique Checkboxes!?
Moderator: General Moderators
Hi, when I first stumbled across this same situation, I was always a little lost as to what people meant, so I'd thought I would add a lil' summin to help clarify 

Code: Select all
<?php
if (isset($_POST['delete'])) {
foreach ($_POST['delete'] as $del) {
echo "$del<br />\n";
}
} else {
echo "<html>
<head>
<title>Testing..</title>
</head>
<body>
<form method=\"post\" action=\"\">
<input type=\"checkbox\" name=\"delete[]\" value=\"1\" /><br />
<input type=\"checkbox\" name=\"delete[]\" value=\"2\" /><br />
<input type=\"checkbox\" name=\"delete[]\" value=\"3\" /><br />
<input type=\"checkbox\" name=\"delete[]\" value=\"4\" /><br />
<input type=\"checkbox\" name=\"delete[]\" value=\"5\" /><br />
<input type=\"submit\" value=\"Submit\" />
</form>
</body>
</html>\n";
}
?>