sju
19.08.2009, 14:31:16
switch ($input) {
case "text":
echo "<input type='text' name='$variable'>";
break;
case "bezeichnungundtext":
echo "<table>
<tr>
<td>$bezeichnung</td>
<td> </td>
<td><input type='text' name=''></td>
</tr>
</table>";
break;
case "textarea":
echo "<input type='textarea' name=''>";
break;
case "checkbox":
echo "<input type='checkbox' name='' value='Ja'>Ja";
echo " <input type='checkbox' name='' value='Nein'>Nein" ;
break;
case "radio":
echo "<input type='radio' name='$variable' value='Ja'>Ja";
echo " <input type='radio' name='$variable' value='Nein'>Nein" ;
}
if ($input=="radio" and input value="Nein") {
$id=$id+2;
}
else {
$id=$id+1;
}
$_SESSION['id']=$id;
Ich hätte gerne, dass für alle verschiedenen Inputtypen die §id um 1 erhöht wird, nur wenn ich als input type = radio habe und als value "Nein" habe, soll er die §id um 2 erhöhen.
Allerdings klappt das bei mir leider nicht.
Kann mir jemand helfen?
case "text":
echo "<input type='text' name='$variable'>";
break;
case "bezeichnungundtext":
echo "<table>
<tr>
<td>$bezeichnung</td>
<td> </td>
<td><input type='text' name=''></td>
</tr>
</table>";
break;
case "textarea":
echo "<input type='textarea' name=''>";
break;
case "checkbox":
echo "<input type='checkbox' name='' value='Ja'>Ja";
echo " <input type='checkbox' name='' value='Nein'>Nein" ;
break;
case "radio":
echo "<input type='radio' name='$variable' value='Ja'>Ja";
echo " <input type='radio' name='$variable' value='Nein'>Nein" ;
}
if ($input=="radio" and input value="Nein") {
$id=$id+2;
}
else {
$id=$id+1;
}
$_SESSION['id']=$id;
Ich hätte gerne, dass für alle verschiedenen Inputtypen die §id um 1 erhöht wird, nur wenn ich als input type = radio habe und als value "Nein" habe, soll er die §id um 2 erhöhen.
Allerdings klappt das bei mir leider nicht.
Kann mir jemand helfen?