$error = "Unknown Error";
     }
     $login_output .= "<div class='alert alert-danger'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>The reCAPTCHA wasn't entered correctly. Go back and try it again." . " (reCAPTCHA said: " . $error . ")</div>";
     if ($debug) {
         $login_output .= "<pre>" . displayDebug($resp) . "</pre>";
     }
 } else {
     // Successful verification
     if (preg_match($email_preg, $_POST['username'])) {
         if ($_POST['password'] == $_POST['password2']) {
             if (preg_match('/(?=^.{' . $minimum_password_length . ',}$)((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/', $_POST['password']) || strlen($_POST['password']) >= $password_threshold_length) {
                 $res = $user->createUser($_POST['username'], $_POST['password'], array($_POST['fname'], $_POST['lname']), $_POST['dname'], $_POST['phone']);
                 if ($res["status"]) {
                     $login_output .= "<div class='alert alert-success text-center force-center'><button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\n<h3> " . $res["message"] . " </h3><p>You can <a class='alert-link' href='" . $self_url . "'>return to your profile page here</a>.</p></div>";
                     //jumpto1
                     if ($user->needsManualAuth()) {
                         $login_output .= "<div class='alert alert-warning text-center force-center'><p>Your ability to login will be restricted until you've been authorized.</p></div>";
                     }
                     // email user
                     $to = $_POST['username'];
                     $headers = 'MIME-Version: 1.0' . "\r\n";
                     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                     $headers .= "From: [" . $shorturl . "] Mailer Bot <blackhole@" . $shorturl . ">";
                     $subject = 'New Account Creation';
                     $body = "<p>Congratulations! Your new account has been created. Your username is this email address ({$to}). We do not keep a record of your password we can access, so please be sure to remember it!</p><p>If you do forget your password, you can go to the login page to reset it. All secure data will be lost in the reset.</p>";
                     if (mail($to, $subject, $body, $headers)) {
                         $login_output .= "<p>A confirmation email has been sent to your inbox at {$to} .</p>";
                     } else {
                         // no email
                     }
                     /***