slet knap virker ikke
er der ikke en der vil hjælpe mig min slet knap virker ikkeKODE>>>>>>>>>>>>>>>
setlocale(LC_ALL, "da_DK");
if ($_POST[submit]) {
include ('config.php');
$db = mysql_select_db("dvddata_dvddatabasen");
$sql = "INSERT INTO dvdudlaan (user_id, filmnr, wdato) VALUES ('$_POST[user_id]', $_POST[filmnr], now())";
//$sql = "INSERT INTO dvdudlaan (navn, film, filmnr, wdato) VALUES ('$_POST[navn]', '$_POST[film]', $_POST[filmnr], '$_POST[wdato]')";
mysql_query($sql) or die(mysql_error());
}
if ($_POST[slet]) {
include ('config.php');
$db = mysql_select_db("dvddata_dvddatabasen");
$sql = "DELETE FROM dvdudlaan WHERE filmnr = $_POST[filmnr]";
mysql_query($sql) or die(mysql_error());
}
?>
<html>
<head>
</head>
<body>
<center>
<p> <b><span class='small6'>Indsæt en ny dvdfilm til udlån:</span> </b> </p>
<form action="viewpage.php?page_id=6" method="post">
<table>
<tr> <td> Brugernavn: </td> <td> <select name="user_id">
<?
//VIS DER ER GRUPPE PÅ SKAL DER VÆRE ( WHERE user_groups LIKE '%1%' )
// FØR ( ORDER BY )
include ('config.php');
$sql = "SELECT user_id, user_name FROM fusion_users ORDER BY user_name ASC";
$query = mysql_query($sql);
while($data = mysql_fetch_array($query)) {
print "<option value=\"$data[user_id]\">$data[user_name]</option>\n";
}
?>
</select> </td> </tr>
<tr> <td> Filmnavn: </td> <td> <select name="filmnr">
<?
include ('config.php');
$sql = "SELECT dvdinfos_id, dvdinfos_name FROM fusion_dvdinfos ORDER BY dvdinfos_name ASC";
$query = mysql_query($sql);
while($data = mysql_fetch_array($query)) {
print "<option value=\"$data[dvdinfos_id]\">$data[dvdinfos_name]</option>\n";
}
?> </select>
</td> </tr>
<tr> </tr>
<tr> <td colspan="2"> <input type="submit" name="submit" class="button" value="Indsæt filmen!"> </td> </tr>
</table>
</form>
<br> </center>
<hr>
<br>
<b>Udlånte film:<b>
<br>
<?
include ("config.php");
$db = mysql_select_db("dvddata_dvddatabasen");
$sql = "SELECT UNIX_TIMESTAMP(du.wdato) AS wdato, du.filmnr, u.user_name, dvd.dvdinfos_name FROM dvdudlaan AS du, fusion_users AS u, fusion_dvdinfos AS dvd WHERE du.user_id = u.user_id AND dvd.dvdinfos_id = du.filmnr ORDER BY u.user_name ASC";
$query = mysql_query($sql);
while($data = mysql_fetch_array($query)) {
echo "<br>";
echo "<div align='center'>";
echo " <center>";
echo " <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' id='AutoNumber1' width='100%'>";
echo " <tr>";
echo " <td width='65' bgcolor='#C0C0C0'> Film id:</td>";
echo " <td width='397' bgcolor='#C0C0C0'> Film Titel</td>";
echo " <td width='200' bgcolor='#C0C0C0'> Medlem</td>";
echo " <td width='150' bgcolor='#C0C0C0'>Data for udlån:</td> ";
echo " <td width='150' bgcolor='#C0C0C0'>Slet film:</td> ";
echo "</tr>";
echo "<tr>";
echo "<form action=\"viewpage.php?page_id=6\" method=\"post\">";
echo "<td width='67'> $data[filmnr]</td>";
echo "<td width='397'><span style='font-weight:bold;color:#000;background-color:#eeee00;'> $data[dvdinfos_name]</span></td>";
echo "<td width='67'><b> $data[user_name]</b></td>";
echo "<td width='101'> " . date("d-m-Y",$data[wdato]) . "</td>";
echo "<td width='101'> <input type=\"submit\" name=\"slet\" value=\"Slet\"Style=\"background:transparent;color: #000000;font: normal 10px verdana,arial,helvetica,sans-serif;border:0px;padding:0px;margin:0px;line-height:1;text-align:center;cursor:pointer;\"> </td>";
echo "</form>";
echo "</tr>";
echo "</table>";
echo "</center>";
echo "</div>";
echo "<br>";
}
?>