PHP ver gevorderde |
|
ik heb als volgd voor:
<form blablabla>
eerst de onafhankelijke checkboxen...
<input type="checkbox" name="check1" value="1" />
<input type="checkbox" name="check2" value="2" />
<input type="checkbox" name="check3" value="3" />
dan hier dus voor meerdere dingen
<input type="radio" name="check4" value="1" />
<input type="radio" name="check4" value="2" />
<input type="radio" name="check4" value="3" />
<input type="submit" name="ok">
</form>
<?php
if(isset($_POST['ok'])){
$var1 = $_POST['check1'];
$var2 = $_POST['check2'];
$var3 = $_POST['check3'];
$var4 = $_POST['check4'];
$sqlpr = "INSERT INTO `table` (var1, var2, var3, var4)
VALUES
('". $var1 ."', ". $var2 ."',
". $var3 ."', ". $var4 ."')
";
mysql_query($sqlpr) or die(mysql_error());
} // alles af sluiten
?>
<form blablabla> eerst de onafhankelijke checkboxen... <input type="checkbox" name="check1" value="1" /> <input type="checkbox" name="check2" value="2" /> <input type="checkbox" name="check3" value="3" /> dan hier dus voor meerdere dingen <input type="radio" name="check4" value="1" /> <input type="radio" name="check4" value="2" /> <input type="radio" name="check4" value="3" /> <input type="submit" name="ok"> </form> <?php $var1 = $_POST['check1']; $var2 = $_POST['check2']; $var3 = $_POST['check3']; $var4 = $_POST['check4']; $sqlpr = "INSERT INTO `table` (var1, var2, var3, var4) VALUES ('". $var1 ."', ". $var2 ."', ". $var3 ."', ". $var4 ."') "; } // alles af sluiten ?>
|