Form Dengan Multiple Checkboxes 23.05.08

Borang dengan beberapa checkbox.

[code lang="php"]
<html>
<body>
<?php
if(isset($_POST['hantar']))
{
$kemahiran = $_POST['kemahiran'];
if(empty($kemahiran))
{
echo("Tiada pilihan dibuat.");
}
else
{
$bil = count($kemahiran);
echo("Anda mempunyai $bil kemahiran : ");
for($i=0; $i < $bil; $i++)
{
print_r("<pre>");
echo($kemahiran[$i] . " ");
print_r("</pre>");
}
}
}
else
{
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Kemahiran anda :<br />
<input type="checkbox" name="kemahiran[]" value="HTML" />HTML<br />
<input type="checkbox" name="kemahiran[]" value="CSS" />CSS<br />
<input type="checkbox" name="kemahiran[]" value="Javascript" />Javascript<br />
<input type="checkbox" name="kemahiran[]" value="PHP" />PHP<br />
<input type="checkbox" name="kemahiran[]" value="MySQL" />MySQL
<input type="submit" name="hantar" value="Hantar" />
</form>

<?php
}
?>

</body>
</html>
[/code]

Demo

Related Articles

Wanna say something?

If you've got an opinion about Form Dengan Multiple Checkboxes - then why not say something? You can even subscribe to these comments via RSS!

:

: