|
Posted by ulyx on 12/07/06 09:20
don't need this ?>
This is just typing error, but there is still no update :-((
----------------------------------------------------------
<form action="testCheckBox.php" name="test" method="post">
<?
$weekdays = array( "mon" => "Monday",
"tue" => "Tuesday",
"wed" => "Wednesday",
"thr" => "Thursday",
"fri" => "Friday",
"sat" => "Saturday",
"sun" => "Sunday" );
// initialize $days as being empty:
$days = array();
echo "<b>Days of Service:</b><br />";
foreach( $weekdays as $value => $desc ) { //walk through possible values
echo ' <INPUT type="checkbox" name=days[]" value="'.$value.'"';
echo ( in_array( $value,$days ) ) ? " CHECKED" : ""; //if days are
already selected, check the box
echo '>'.$desc.'<br />'; //echo the descriptive name of the item
}
$daylist = implode(",",$days);
//$result = mysql_query("UPDATE dbTest SET db_days = '$daylist' WHILE
record_id = $record_id");
$days = explode(",", $dbTest ['db_days']);
?>
<input type="submit" name="Submit" value="Submit">
</form>
------------------------------------------------------------------------
Navigation:
[Reply to this message]
|