Quoting chad qian <[EMAIL PROTECTED]>:


Hi,

Here is my current code:
<input type="checkbox" name="checkbox" value="1" checked="checked" />

I want:
When checkbox is checked,i want to insert the value"1" to mysql database.
When checkbox is unchecked,i want to insert the value "0" to mysql database.

Only checked checkbox values are returned to your php script, so you have to do something like:

<?php
$insertval = (isset($_POST['checkbox']))?$_POST['checkbox']:'0';
?>

Ken

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to