示例#1
0
}
if ($action && !preg_match('/^[a-zA-Z0-9\\s_]+$/', $action)) {
    $action = '';
}
if ($action == "Create Login") {
    $okToCreateLogin = true;
    if ($useRecaptcha) {
        $resp = recaptcha_check_answer($RECAPTCHA_PRIVATE_KEY, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            // What happens when the CAPTCHA was entered incorrectly
            $okToCreateLogin = false;
            $displayStr = "The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")";
        }
    }
    if ($okToCreateLogin) {
        if ($pHandler->checkLogin($emailAddr)) {
            if ($pHandler->register($_POST)) {
                header("Location: viewprofile.php");
            } else {
                $displayStr = 'FAILED: Unable to create user.<div style="margin-left:55px;">Please contact system administrator for assistance.</div>';
            }
        } else {
            $displayStr = $pHandler->getErrorStr();
        }
    }
}
?>
<html>
<head>
	<title><?php 
echo $defaultTitle;