" . mysql_error($mysql)); $connection = @mysql_select_db($database, $mysql); $result_exists_in_user = @mysql_query("SELECT `username` FROM `user` WHERE `username`='" . $email . "'",$mysql) or print_base_html("Registration Result","Error!","Your registration could not be completed at this time. The error message reported is:

" . mysql_error($mysql)); $result_exists_in_newuserqueue = @mysql_query("SELECT `username` FROM `newuserqueue` WHERE `username`='" . $email . "'",$mysql) or print_base_html("Registration Result","Error!","Your registration could not be completed at this time. The error message reported is:

" . mysql_error($mysql)); if(mysql_num_rows($result_exists_in_user)) { $form = get_reg_form($fullname,$company,$email,$position,$comments,"The email address entered is already in use. Retrieve your password here. ",$promcode,$pass1); print_base_html("New User Registration","Please fill in the form completely",$form); } if(mysql_num_rows($result_exists_in_newuserqueue)) { $form = get_reg_form($fullname,$company,$email,$position,$comments,"The email address entered has already begun the registration process. You are now required to confirm your registration by following a link we send you in email. If you did not receive the email and need another click here. ",$promcode,$pass1); print_base_html("New User Registration","Please fill in the form completely",$form); } //Server side validation of all form data // if all fields exist if(isset($fullname) && isset($company) && isset($email) && isset($pass1) && isset($position) && isset($language) &&isset($colorcode)) { // if all fields are nonzero if((strlen($fullname) == 0) || (strlen($company) == 0) || (strlen($email) == 0)|| (checkEmail($email) == TRUE) || (strlen($pass1) == 0) || ($position == "Select")) { $form = get_reg_form($fullname,$company,$email,$position,$comments,"Incomplete Data. Required fields must be filled in and cannot have only spaces. " ,$promcode,$pass1); print_base_html("New User Registration","Please fill in the form completely",$form); } // if pornspam detected, lie. Say our server is down. // pornspam has html markup in comments or company name. $pornspam = FALSE; $findme = 'http'; if (!(strpos($company, $findme) === FALSE)) { $pornspam = TRUE; } if (!(strpos($comments, $findme) === FALSE)) { $pornspam = TRUE; } if ($pornspam) { print_base_html("Registration Result","Problem!","New user registration is offline. Please try back later."); } } else { $form = get_reg_form($fullname,$company,$email,$position,$comments,"Incomplete Data. Required fields must be filled in and cannot have only spaces.",$promcode,$pass1); print_base_html("New User Registration","Please fill in the form completely",$form); } $result = @mysql_query("INSERT INTO `vam`.`newuserqueue` (`username`,`fullname`,`company`,`position`,`comments`,`voucher_id`,`passwd`,`Language`,`Colorcode`) VALUES('" . strtolower($email) . "','$fullname','$company','$position','$comments','$promcode','$pass1','$language','$colorcode')",$mysql) or print_base_html("Registration Result","Error","Your registration could not be completed at this time. The error message reported is:

" . mysql_error($mysql)); $confirm_id = mysql_insert_id($mysql); if($confirm_id == 0) { send_notify("VAM Admin Notification - Registration Offline","User with the email \"$email\" could not be added to the newuserqueue table. mysql_insert_id($mysql) returned 0."); print_base_html("Registration Result","Problem!","New user registration is offline. Please try back later."); } else { $form = get_welcome_message($fullname,$company,$email,$position,$comments,$promcode,$pass1,$confirm_id); send_welcome($form,$email); if($reg_notify) { $form = get_welcome_message($fullname,$company,$email,$position,$comments,$promcode,$confirm_id,$confirm_id); send_notify("VAM Admin Notification - New Account Registered (Not confirmed)",$form); } $form = get_reg_success($fullname,$company,$email,$position,$comments,$promcode); print_base_html("Registration Result","Check your email to confirm your registration!",$form); } } else { $form = get_reg_form("","","","","","","",""); print_base_html("New User Registration","Your User Name will be your Email Address",$form); } mysql_close($mysql); ?>