function cw_image_verification_on_register_validate($register, $usertype)
{
    global $config;
    $result = false;
    $page = "on_registration";
    $antibot_err =& cw_session_register("antibot_err");
    global $antibot_validation_val, $antibot_input_str;
    if ($config['image_verification']['spambot_arrest_on_registration'] == "Y") {
        $antibot_err = false;
        if (isset($antibot_input_str) && !empty($antibot_input_str)) {
            $antibot_err = cw_validate_image($antibot_validation_val[$page], $antibot_input_str);
        } else {
            $antibot_err = true;
        }
        if ($antibot_err) {
            $result = array('image_verification' => 'Please enter correct graphic code');
        }
    }
    return $result;
}
 if (!$survey['valid']) {
     $top_messsage = array('content' => cw_get_langvar_by_name('txt_survey_is_invalid_customer_warning'), 'type' => 'E');
     cw_header_location('index.php?target=' . $target);
 }
 $fill_customer_id = $customer_id;
 $fill_user = false;
 if (!empty($survey_key)) {
     $fill_user = cw_query_first("SELECT email, customer_id, as_result FROM {$tables['survey_maillist']} WHERE access_key = '{$survey_key}' AND survey_id = '{$survey_id}'");
     if (!empty($fill_user['customer_id'])) {
         $fill_customer_id = $fill_user['customer_id'];
     }
 }
 $page = 'on_surveys';
 if ($addons['image_verification'] && $show_antibot_arr[$page] == 'Y') {
     if (isset($antibot_input_str) && !empty($antibot_input_str)) {
         $antibot_err = cw_validate_image($antibot_validation_val[$page], $antibot_input_str);
     } else {
         $antibot_err = true;
     }
     if ($antibot_err) {
         $top_message['type'] = "E";
         $top_message['content'] = cw_get_langvar_by_name("msg_err_antibot");
         cw_header_location("index.php?target={$target}&survey_id=" . $survey_id);
     }
 }
 # Check if survey results is empty
 if (cw_is_survey_result_empty($data) || !is_array($data)) {
     $top_message['type'] = 'W';
     $top_message['content'] = cw_get_langvar_by_name("txt_survey_is_empty_message");
     cw_header_location("index.php?target={$target}&survey_id={$survey_id}");
 }