コード例 #1
0
ファイル: index.php プロジェクト: Osohm/osohm_web_pages
require_once '../shared_php/error_handling.php';
/*
 * Vars declaraction and initialization.
 */
// Header variables.
$page_title = 'Forgot Password - CAT';
$page_description = 'Forgot password page';
$page_author = 'CAT team';
//$page_styles = 'css/login.css';
//page script variables.
$page_result_code = SUCCESS_NO_ERROR;
$page_message = "Input your username, we will send you an email to reset your password";
$user_name = "";
session_start();
// if a login session exists, make sure you redirect to the my account page.
if (check_login_session() == SUCCESS_NO_ERROR) {
    // redirect to the 'user_account' page
    // REMEMBER:
    // header() must be called before any actual output is
    // sent, either by normal HTML tags, blank lines in a file, or from PHP.
    // plus addressess must be absolute (we need to change this)
    header("Location: ../user_account/index.php");
} else {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        // Create short variable names.
        $user_name = $_POST['user_name'];
        $page_result_code = validate_reset_password_form($user_name);
        // if validation was succesful
        if ($page_result_code == SUCCESS_NO_ERROR) {
            // generate a random password.
            // update password in users database.
コード例 #2
0
ファイル: index.php プロジェクト: Osohm/osohm_web_pages
$page_title = 'Registration - CAT';
$page_description = 'registration page';
$page_author = 'CAT team';
//$page_styles = 'css/registration.css';
// page script variables.
$page_result_code = 0;
$page_message = "Please enter your registration information";
$user_email = "";
$user_name = "";
$user_password = "";
$user_password2 = "";
/*
 * Page script logic
 */
session_start();
$page_result_code = check_login_session();
// if a login session exists, make sure you redirect to the my account page.
if ($page_result_code == SUCCESS_NO_ERROR) {
    // redirect to the 'user_account' page
    // REMEMBER:
    // header() must be called before any actual output is
    // sent, either by normal HTML tags, blank lines in a file, or from PHP.
    // plus addressess must be absolute (we need to change this)
    header("Location: ../user_account/index.php");
} else {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        // Create short variable names.
        $user_email = $_POST['user_email'];
        $user_name = $_POST['user_name'];
        $user_password = $_POST['user_password'];
        $user_password2 = $_POST['user_password2'];