Recently while working with checkbox, I've to go through following test code:
<?php if ( isset( $_POST['myname'] ) ) {
$myvalue = $_POST['myname'];
echo $myvalue; } ?>
<form method="post">
<input type="checkbox" name="myname" />
<input type="submit" name="send" /></form>
So, what output I got after form submission is when checkbox is checked it prints 'on' else nothing (if value is not provided on checkbox). And isn't it supposed to print 1(true) on checking the checkbox. What that 'on' means in PHP?
Aucun commentaire:
Enregistrer un commentaire