Ejemplo n.º 1
0
function loadForm($formPass)
{
    echo "<h1>Reset your Password</h1>";
    $form = new HtmlForm();
    $form->renderStart("resetPasswordForm", "");
    $form->renderPassword("newPassword1", "New Password ", true, 255);
    $form->renderPassword("newPassword2", "Confirm New Password ", true, 255);
    if (!$formPass && !checkPasswordMatch()) {
        echo "<span class='pswdMtchFail'>does not match new password entered</span>";
    }
    $form->renderSubmitEnd("submitReset", "Change Password");
}
function loadForm($formPass)
{
    echo "<h1>Change your Password</h1>";
    $form = new HtmlForm();
    $form->renderStart("changePasswordForm", "");
    $form->renderPassword("currentPassword", "Current Password: "******"<span class='pswdMtchFail'>This is not your password. Forgot your password? <a href='ResetPassword.php'>Reset it here</a></span>";
    }
    $form->renderPassword("newPassword1", "New Password: "******"newPassword2", "Again: ", true, 255);
    if (!$formPass && !checkPasswordMatch()) {
        echo "<span class='pswdMtchFail'>does not match new password entered</span>";
    }
    $form->renderSubmitEnd("submitPasswordChange", "Change Password");
}
Ejemplo n.º 3
0
$form = new HtmlForm();
?>

<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
        <link type=text/css" rel="stylesheet" href="style/SecretStyles.css" />
        <title>Login</title>
    </head>
    <body>
        <div class="container">
            <?php 
$form->renderStart("loginForm", "Enter your username and password");
$form->renderTextbox("username", "Username", true);
$form->renderPassword("password", "Password", true);
$form->renderSubmitEnd("submitLogin", "Submit");
?>
            <div id="linking">
                <p> Don't have an account?<a href="register.php" > Click Here</a> to register!</a></p>
                <p>Forgot Your Password? <a href="ResetPassword.php">click here</a> to reset your password</p>
            </div>
        </div>
        <div id="toExplore">
            //Insert Image Link Here
        </div>
    </body>
</html>
Ejemplo n.º 4
0
function loadForm($formPass)
{
    //note: there are echoed divs here to help render error messages
    //if the passwords do not match. The way error checking is done
    //by renderTextBox does not allow for other error messages otherwise.
    //I needed to improvise here - seems to work.
    $form = new HtmlForm();
    $form->renderStart("frmRegisterForm", "Register", true);
    echo "<div >";
    $form->renderTextbox("txtUsername", "Username:"******"", "pattern='^[A-Za-z0-9\\_]{3,25}\$'");
    echo "<span id = 'pWord'></span>";
    echo "</div>";
    echo "<div>";
    $form->renderTextbox("txtEmail", "Email:", true, 50, "", "pattern='^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}\$'");
    echo "</div>";
    echo "<div>";
    $form->renderPassword("txtPassword", "Password:"******"</div>";
    //if the passwords entered match
    if ($formPass) {
        echo "<div>";
        $form->renderPassword("txtRetypePassword", "Retype Password:"******"</div>";
    } else {
        if (!$formPass && !checkPasswordMatch()) {
            echo "<div>";
            $form->renderPassword("txtRetypePassword", "Retype Password:"******"txtRetypePassword"])) {
                echo "<span class='pswdMtchFail'>does not match password entered</span>";
                echo "</div>";
            }
        } else {
            $form->renderPassword("txtRetypePassword", "Retype Password:"******"<div>";
        $form->renderTextbox("txtQst1", "Enter a challenge question: ", true, 255, "", "");
        echo "</div>";
        echo "<div>";
        $form->renderTextbox("txtQst1Answer", "Answer: ", true, 255, "", "");
        echo "</div>";
        echo "<div>";
        $form->renderTextbox("txtQst2", "Enter another challenge question: ", true, 255, "", "");
        echo "</div>";
        echo "<div>";
        $form->renderTextbox("txtQst2Answer", "Answer: ", true, 255, "", "");
        echo "</div>";
    } else {
        if (!$formPass && !checkChallengeQuestions()) {
            echo "<div>";
            $form->renderTextbox("txtQst1", "Enter a challenge question: ", true, 255, "", "");
            echo "</div>";
            echo "<div>";
            $form->renderTextbox("txtQst1Answer", "Answer: ", true, 255, "", "");
            echo "</div>";
            echo "<div>";
            $form->renderTextbox("txtQst2", "Enter another challenge question: ", true, 255, "", "");
            echo "<span class='QstMtchFail'>Your challenge questions cannot be the same</span>";
            echo "</div>";
            echo "<div>";
            $form->renderTextbox("txtQst2Answer", "Answer: ", true, 255, "", "");
            echo "</div>";
        } else {
            if (!$formPass && checkChallengeQuestions()) {
                echo "<div>";
                $form->renderTextbox("txtQst1", "Enter a challenge question: ", true, 255, "", "");
                echo "</div>";
                echo "<div>";
                $form->renderTextbox("txtQst1Answer", "Answer: ", true, 255, "", "");
                echo "</div>";
                echo "<div>";
                $form->renderTextbox("txtQst2", "Enter another challenge question: ", true, 255, "", "");
                echo "</div>";
                echo "<div>";
                $form->renderTextbox("txtQst2Answer", "Answer: ", true, 255, "", "");
                echo "</div>";
            }
        }
    }
    $form->renderSubmitEnd("subRegisterSubmit", "Register");
}