Hallo,
Ich habe Probleme die Werte von Checkboxen aus meinem Formular auszulesen.
Das Formular:
function show_form()
{
echo <<<FORM
<form action="newdepot.php" method="post">
<table border="0">
<tr valign="bottom">
<!--Eingabe DepotNR-->
<td>Depot-Nr.:</td>
<td><input type="text" Name="fdepotnr" size="3" maxlength="3"
value ="$fdepotnr"></td>
</tr>
<tr valign="bottom">
<!--Eingabe Produkte-->
<td>Produkte:</td>
<td>
FORM;
$sql="select name from produkt order by name";
create_checkbox($sql, "fprodukte[]");
echo <<<FORM2
</td>
</tr>
<tr valign="bottom">
<!--Eingabe HUB/RUP-->
<td>HUB/RUP:</td>
<td>
FORM2;
$sql="select name from umschlag order by idnr";
create_checkbox($sql, "fhubrup[]");
echo <<<FORM3
</td>
</tr>
<td></td>
<!--Button zum Eintragen der eingegebenen Daten-->
<td><input type="submit" name="feintragen" value="Eintragen" size="20"></td>
</tr>
</table>
</form>
FORM3;
}//show_form
Die Funktion create_checkbox:
//create_checkbox gibt eine bestimmte anzahl von checkboxen aus
function create_checkbox( $sql, $name, $br=false)
{
$conid=connect_db();
$res=mysql_query($sql, $conid);
if(!$res)
{
return false;
}else
{
while($row=mysql_fetch_row($res))
{
echo("<input type="checkbox" name="$name\ "value="$row[0]">$row[0]");
if($br) echo("<br>");
}
mysql_free_result($res);
return true;
}
}
So jetzt habe ich das Problem, dass die Variablen $fprodukte und $fhubrup keinerlei werte enthalten, und auch keine Arrays sind.
Woran könnte das liegen?
Danke
Tobi