PHP-Code:
function load() {
global $temp_adr_id, $id, $kateg, $kategorie;
$kategorie = explode(";", $kateg);
print_r($kategorie);
echo "<form name=\"kateg\" method=\"post\" action=\"kateg.php?action=write&temp_adr_id=$temp_adr_id\">";
$read_003 = mysql_query("SELECT * FROM msc_kateg ORDER BY name");
while(list($id, $name) = mysql_fetch_row($read_003))
{
$key = array_search($name, $kategorie);
if ($key!==null&&$key!==false) {
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\" checked> $name<br>";
}
else
{
echo "<input type=\"checkbox\" name=\"kateg[]\" value=\"$name\"> $name<br>";
}
}
print_r($kategorie);
echo "<input type=\"submit\" name=\"Submit\" value=\"Abschicken\">
</form>";
}
Gru? manfred
Kommentar