The following code is suppesed to make a multiple deletion with checkboxes possible. The query and the appearance is fine, but when I press the Submit button it seems to me that the values of ACTION_ITEMS_1,2,... are not given to the query. I hope you can understand what I want.
Here is the code:
<head><title>Tanszeki dolgozok torlese</title></head>
<body>
<h1>Tanszéki dolgozók törlése</h1>
<h3>(Jelölje ki a törölni kívánt rekordokat, majd kattintson a Töröl gombra!)</h3>
<table border="3" cellspacing="5" cellpadding="5">
<form action="<? print $PHP_SELF ; ?>" method="post">
<?
$dbhost = MYHOST ;
$dbuser = MYUSER ;
$dbpass = MYPASSWORD ;
$db = mysql_connect($dbhost,$dbuser,$dbpass) or die("Hiba a kapcsolódáskor!") ;
$dbname = "gepek" ;
mysql_select_db($dbname,$db) ;
if ($submit)
{
$i = 1 ;
while (eval("return \$action_items$i ;"))
{
eval("\$azonosito = \"\$action_items$i\";") ;
$torol_query = "delete from tanszeki_dolgozok
where azonosito=$action_items[$i]" ;
mysql_query($torol_query,$db) ;
$i++ ;
}
}
$query = "select * from tanszeki_dolgozok order by nev" ;
$result = mysql_query($query,$db) ;
$i = 0 ;
while ($adat = mysql_fetch_array($result))
{
$i++ ; ?>
<tr><td><input type="checkbox" name="<? echo "action_items_".$i ; ?>
value="<? echo $adat["azonosito"] ?>"></td>
<td><? echo $adat["azonosito"] ?></td>
<td><? echo $adat["nev"] ?></td>
<td><? echo $adat["email_cim"] ?></td>
</tr>
<? } ?>
<tr><td><input type="submit" name="submit" value="Torol"></td></tr>
</table>
</form>
<a href="admin_menu.html">Vissza</a>
</body>