include_once("library/config.php"); ?> // it means member already logged in if(isset($_SESSION['cel_celebrant_id']) && isset($_SESSION['cel_user_name']) && isset($_SESSION['cel_email'])) { $login_link = "member/index.php"; header("location: ".$login_link); exit; } ?> // For Recaptcha Library require_once('library/recaptchalib.php'); // Get a key from http://recaptcha.net/api/getkey $publickey = getReCaptchaPublicKey(); $privatekey = getReCaptchaPrivateKey(); # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $captcha_error = null; ?> $show_msg = ""; if(isset($_REQUEST['action'])) { $action = $_REQUEST['action']; if($action == "invalid") { $show_msg = "Invalid Username or Password."; } elseif($action == "logout") { $show_msg = "Logout successfully!"; } } ?> $err_msg = ""; if(isset($_POST['btn_forgotpwd'])) { die; header("Location: index.php"); // do not accept forgotten passwords extract($_POST); $recaptcha_challenge_field = ""; $recaptcha_response_field=""; if(isset($_POST['recaptcha_challenge_field'])) { $recaptcha_challenge_field = $_POST['recaptcha_challenge_field']; } if(isset($_POST['recaptcha_response_field'])) { $recaptcha_response_field = $_POST['recaptcha_response_field']; } $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field, $recaptcha_response_field); if ($resp->is_valid) // valid captcha code { /* $your_email = $_POST['your_email']; $sql = "select user_name, password from celebrants where email = '$your_email'"; $res = $db->ExecuteQuery($sql); $rcount = $res->GetSelectedRows(); if ($rcount > 0) { list($user_name, $password)= $res->FetchAsArray(); $sql = "SELECT etemp_id, email_subject, email_message FROM email_templates where etemp_id = '2'"; $res = $db->ExecuteQuery($sql); list($etemp_id, $email_subject, $email_message)=$res->FetchAsArray(); $email_message = str_replace ( "USER_NAME", $user_name, $email_message); $email_message = str_replace ( "USER_PWD", $password, $email_message); // sendEmail($your_email, $email_subject, $email_message, $cc="", $from_name="", $from_email=""); header("Location: msg.php?action=forgot_pwd"); exit(); } else // captcha code is invalid { $err_msg = "Wrong email address!"; }*/ } else { # set the error code so that we can display it $captcha_error = $resp->error; } } $sql = "SELECT is_update_send FROM content WHERE content_id='1' "; $res = $db->ExecuteQuery($sql); list($is_update_send)=$res->FetchAsArray(); ?>