if the checkbox isnt set then its set to 0
use $GET or $POST instead, the way your doing is veryinscure. Also use isset function
if (!isset($_POST['agree']) OR $_POST['agree']==0) {
echo $error_message;
}
else { // the rest of the script
the undefined varible error is actully a notice and you can ignore them, but better to fix them
Heres a better way to do this
if(isset($_POST['agree']) {
if($_POST['agree']) { SET TO 1}
else {SET TO 0}
} else { NOT SET }