BjoernJackschina wrote:
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
Hi BjoernJackschina,
Suppose you have a page with a form: login.php
the action in the form is login_process.php
Just let login_process.php return to login.php with an reason stored in the
GET.
eg:
login.php
-------------------------
<form action="login_process.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.php
--------------------------
<?
// 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 == "BjoernJackschina") AND ($password == "secret")) {
// ok
$_SESSION["isadmin"] = "Y";
// send somewhere to continue
header("Location: admin.php");
} else {
// not ok
header("Location: login.php?result=".urlencode("bad username/password"));
}
?>
------------------------------
Regards,
Erwin Moller