I am trying to have an RSVP form on my wedding site but I am encountering a problem.
In the form, I want to ask my friends to choose which part of the day they will join, such as morning church ceremony, afternoon cocktail and/or dinner banquet. The website can be found here: http://www.chocolate-circle.com/joeyfrancis/
My mysql database can receive all data, including the name and comments from my friends but I have no luck in receiving which boxes are checked.
I have the fields “church”, “cocktail” and “dinner” in my DB. I have been googling for a few days and nights now and the only codes that are not generating any errors should run to check whether the boxes are checked. There are no errors displaying but I am not receiving any data in the db fields concerned.
Then I tried to test the fields with just textboxes instead of checkboxes and, in this case, the fields get the data.
I am in deep frustration to trying to make it work but with no luck. if anyone can enlighten me on what is wrong with my codes I would greatly appreciate. Here are the codes:
// Form for submitting new entries
$output .= ’
<form id=“new_entry” style=“text-align:left;” action=“‘.$gb_links[‘write’].’” accept-charset=“UTF-8” method=“POST”>
<input type=“hidden” name=“gb_link” id=“gb_link” value=“‘.$gb_links[‘plain’].’”>
<input type=“hidden” name=“gwolle_gb_function” value=“add_entry” />
<div class=“label”>‘.__(‘Name’,$textdomain).’:</div>
<div class=“input”><input class=“‘; if (in_array(‘name’, $error_fields)) { $output .= ’ error’; } $output .= '” value=“‘.$name.’” type=“text” name=“entry_author_name” /></div>
<div class=“clearBoth”> </div>
<div class="label">'.__('You’re interested in joining our',$textdomain).':</div>
<div>Noon Church Ceremony <input type="checkbox" name="chuch" value="church" />
Afternoon Cocktail <input type="checkbox" name="cocktail" value="cocktail" />
Dinner Party <input type="checkbox" name="dinner" value="dinner" /></div>
<?php
if (church != NULL) {
church = 1;
}
else {
church = 0;
}
if (cocktail != NULL) {
cocktail = 1;
}
else {
cocktail = 0;
}
if (dinner != NULL) {
dinner = 1;
}
else {
dinner = 0;
}
?>