Burner: Doppelposting

Beitrag lesen

hi ischen,

habe es soweit hinbekommen, habe allerdings noch ein kleines problem.das löschen funktioniert einfach nicht, kannst du es dir mal anschauen?

dank dir
gruß
burner

Script das die Dateien ausgibt:
<html>
   <head>
  <link rel="stylesheet" href="site.css" type="text/css">
     <title>Filme ausgeben</title>
   </head>

<body bgcolor="#89a8b9">

<span class="content"><h2>Filme</h2>
  <center>
  <script language="JavaScript">function import_dvd(){ MeinFenster =
 window.open("importdvd1.php", "Zweitfenster", "width=650,height=250,scrollbars");
 MeinFenster.focus();}</script>
 <b>&nbsp;<a href="javascript:import_dvd()"importdvd1.php" class="link">Film hinzufügen</a>&nbsp;
 <script language="JavaScript">function Websearch(){ MeinFenster =
 window.open("searcher.htm", "Zweitfenster", "width=650,height=500,scrollbars");
 MeinFenster.focus();}</script><b>
  &nbsp;&nbsp;&nbsp;<a href="javascript:Websearch()"searcher.htm" class="link">&#149;&nbsp;Search</a>
  <a href="links.html" class="link">&#149;&nbsp;Weitere Links</a>
  <a href="kontakte.php" class="link" target="_blank">&#149;&nbsp;Kontakte</a>
  <a href="dvdaus.php" class="link">&#149;&nbsp;Filme</a></center><br>
     <?php
         $db=mysql_connect("localhost","","");
         $ergebnis=mysql_db_query("test", "select * from dvd order by titel");
         $anzahl=mysql_num_rows($ergebnis);
         mysql_close($db);
         print $anzahl . "Filme gespeichert";

?>
  <form name="form1" method="post" action="loeschen.php">
       <table border="1" width="100%">
       <tr>
         <th></th>
   <th>Titel</th>
         <th>Typ</th>
         <th>Kategorie</th>
         <th>Language</th>

</tr>
      <?php
         for ($i=0;$i<$anzahl;$i++) {
           $id = mysql_result($ergebnis, $i, "id");
     $check = "<input type="checkbox" name="checkbox[$id]" value="$id">";
           $tit = mysql_result($ergebnis, $i, "titel");
           $typ = mysql_result($ergebnis, $i, "typ");
           $kat = mysql_result($ergebnis, $i, "kategorie");
           $lan = mysql_result($ergebnis, $i, "language");

print "<tr><td>".$check."<td>".$tit."</td><td>".$typ."</td><td>".$kat."</td><td>".$lan."</td></tr>\n";
       }

?>
      </table>
    <input type="submit" name="loeschen" value="Ausgewählte löschen">
    </form>
    </body>
</html>

hier noch die loeschen.php

<?php
$db=mysql_connect("localhost","","");
if(isset($_POST['checkbox'])&&is_array($_POST['checkbox']))
    {
        foreach($_POST['checkbox']as $aID=>$value)
            {
             $sql = "delete from dvd where id = $aID";
             mysql_query($sql);
            }
    mysql_close ($db);
    echo "alles OK";
    }

?>
 <a href="dvdaus2.php" class="link">Zurück zur Übersicht</a>