Rakedia: [ Hab es geschaft ] PHP / JS / HTML

Beitrag lesen

Hallo,

habe es nun so gemacht:

<?php
if(!empty($_POST))
{
foreach ($_POST['beginn'] as $Key => $Bon)
  {
      if (false === emtpy($Von)
      {

$Sql =
   "INSERT INTO veranstaltung
       SET
           beginn           = " . sqlPrepare($Beginn) . "
          ,ende             = " . sqlPrepare($_POST['ende'][$Key]) . "
   ";
   mysql_query($Sql) or die('<pre>' . $Sql . '</pre>' . "\n\n" . mysql_error());
       }
   }
}
?>

<script language="JavaScript">
var counter = 3;
function neuesfeld(id){
counter++;
var tbody = document.getElementById(id).
getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
var input = document.createElement("input");
input.name="beginn[]";
input.id="beginn_"+counter;
td1.appendChild(input);
var input2 = document.createElement("input");
input.name="ende[]";
input.id="ende_"+counter;
var td2 = document.createElement("TD");
td2.appendChild(input2);
row.appendChild(td1);
row.appendChild(td2);
tbody.appendChild(row);
}
</script>

<form action="" method=post>
<table width="80%" border="0" id="interessen">
<tbody>
<tr>
<td width="17%"><input name="beginn[]" type="text" id="beginn[]"></td>
<td width="83%"><input name="ende[]" type="text" id="ende[]"></td>
</tr>
</tbody></table>
<table width="80%" border="0">
<tr>
<td width="99%"><input name="button" type="button" onClick="javascript:neuesfeld('interessen')" value="Feld hinzuf&uuml;gen"></td>
</tr>
</table>
</form>

Gruß,
Rakedia