My checkbox error is also still not completely resolved, but here's a summary of what's left of the problem:
I'm getting a very simple error using php/mysql:
Undefined index: ready_for_enrollment in D:\Inetpub\dist-web\users\sagea\php_mysql\addrecord.php on line 20
I only get this error from a checkbox field and only if that field is set to 0. If it's set to 1 I don't get an error.
Here's the <input> field in the add data form:
<input type=\"checkbox\" name=\"ready_for_enrollment\" id=\"ready_for_enrollment\" value=\"1\">
When the user clicks 'submit' another script processes their entries and inserts them into the db. Here's relevant excerpts from the processing script:
if ("$POST[ready_for_enrollment]" == 1) {
$POST['ready_for_enrollment'] = 1;
} else {
$_POST['ready_for_enrollment'] = 0;
}
$sql = "INSERT INTO $table_name1 (department id, ..., ready_for_enrollment) values ('$POST[department_id]', ..., '$POST[ready_for_enrollment]')";
$result = @($sql,$connection) or die(mysql_error());
Any ideas why I might be getting that error 'undefined index: ready_for_enrollment' ? It's referring to the first line in the 'if' statement on the processing script.
Note: the values are actually being processed and inserted into the db correctly, but they are giving me this ugly error on the submit page that I'd rather not see.
Thanks,
S./