checkbox php form yazı ile kontrol?

2 Cevap php

nasıl bir onay kutusunu kontrol edebilirim? Ben, Evet bu işe yaramazsa üzerinde, 1 denedim. koyarak yalnız eserlerini "kontrol" ama sonra nasıl kontrol edilir onay kutusu form post sonra php ile kontrol edebilirim? çalıştı

<input type="checkbox" class="inputcheckbox" id="newmsg" name=chk[newmsg2] value="1" />

2 Cevap

Bu kontrol edilir eğer bir onay kutusu yalnızca başarılı bir denetim olacaktır.

Başarılı değildir denetimleri veri olarak teslim edilmez.

Bir onay kutusu 's değeri ibraz edilmiş ise görerek kontrol edilir, bu nedenle, size söyleyebilir.

örneğin

if ($_POST['chk']['newmsg2'] == 1) { 

burada kodu;

<form action="test.php" method="POST">
<input type="checkbox" class="inputcheckbox" id="newmsg" name=chk[newmsg2] value="1" />
<input type="submit">
</form>
<?php
    $check = $_POST['chk']['newmsg2'];
    echo "***$check****"
?>

işaretli ise $ onay 1 gösterecektir.