Vote Up 0 Vote Down

html checkbox value php

How to check html checkbox value in php ?
flag

Answers


Vote Up 0 Vote Down
HTML checkbox in a form can be given as follow :

<input type="checkbox" name="comment" value="yes">


When you post values from HTML form you can get the post value as follows :

<?php
$value = $_POST['comment'];
echo $value; //Print "yes" if value is checked, empty otherwise.
flag | link |

Your Answer

Login before answering

Login with facebook