Jump to content

Checkboxes


ka3pmw

Recommended Posts

I am having a problem with sending the value from a checkbox to a mysql table. If the box is not checked I want to send a 0 if it is I want to send a 1, I also eant to treat the column as an int.

How can I do this?

My input field looks like this:

<td align="left" valign="top">Allow Duplicates</td>

<td colspan="2" align="left" valign="top"><input type="checkbox" name="allow_dupes" id="allow_dupes" value="0" /></td>

mu php code is like this:

extract($_POST);

$sql="INSERT INTO `mylog` (`callclub`, `arrlsect`, `ituzone`, `ituregion`, `grid`, `utcoffset`, `contest`, `logname`, `crossmode`, `xmitters`, `numoperators`, `numstations`,`time_date`, `assisted`, `power`, `overlay`, `allowdupes`, `rrst`, `rdatetime`, `rcallsign`,`rsection`,`rzone`,`rband`,`rmode`,`rfrequ`,`rregion`,`rgridlog`, `srst`, `sdatetime`, `scallsign`,`ssection`,`szone`,`sband`,`smode`,`sfrequ`,`sregion`,`sgridlog`,`name`, `address`, `city`, `state`, `zip`, `country`,`soap1`, `soap2`) VALUES('$call_club','$arrl_section','$itu_zone','$itu_region','$grid','$utc_offset','$contest_name','$log_name','$cross_mode','$numofxmit','$numofops','$numofstations','$timedate','$assistedyn','$power','$overlay_name','$allow_dupes','$rlog_rst','$rlog_date','$rlog_callsign','$rlog_section','$rlog_zone','$rlog_band','$rlog_mode','$rlog_frequency','$rlog_region','$rlog_grid','$slog_rst','$slog_date','$slog_callsign','$slog_section','$slog_zone','$slog_band','$slog_mode','$slog_frequency','$slog_region','$slog_grid','$contact_name','$contact_address','$contact_city','$contact_state','$contact_zip','$contact_country','$soap1','$soap2')";

if (!mysql_query($sql,$con))

Thanks

Link to comment
https://forums.phpfreaks.com/topic/270466-checkboxes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.