Recall

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BjoernJackschina

    Recall

    Hello,
    is there a possibility to recall a page in which I had entered a
    password before with a hint that it was the wrong password.

    Many thanks
  • Erwin Moller

    #2
    Re: Recall

    BjoernJackschin a wrote:
    [color=blue]
    > Hello,
    > is there a possibility to recall a page in which I had entered a
    > password before with a hint that it was the wrong password.
    >
    > Many thanks[/color]

    Hi BjoernJackschin a,

    Suppose you have a page with a form: login.php
    the action in the form is login_process.p hp
    Just let login_process.p hp return to login.php with an reason stored in the
    GET.

    eg:


    login.php
    -------------------------

    <form action="login_p rocess.php" method="POST">
    <?
    if (isset($_GET["result"])) {
    ?>
    <b><? echo $_GET["result"]; ?></b>
    <?
    }
    ?>
    login:<br>
    username: <input type=text name="username" ><br>
    password: <input type=password name="password" ><br>
    <input type="submit" value="login">
    </form>
    -----------------------------



    and login_process.p hp
    --------------------------
    <?
    // Receive username and password
    // If correct, set in SESSION isloggedin
    $username = ((isset($_POST["username"])) ? $_POST["username"] :
    "notpassed" );
    $password = ((isset($_POST["password"])) ? $_POST["password"] :
    "notpassed" );

    if (($username == "BjoernJackschi na") AND ($password == "secret")) {
    // ok
    $_SESSION["isadmin"] = "Y";
    // send somewhere to continue
    header("Locatio n: admin.php");
    } else {
    // not ok
    header("Locatio n: login.php?resul t=".urlencode(" bad username/password"));
    }
    ?>
    ------------------------------

    Regards,
    Erwin Moller


    Comment

    Working...