Good evening po, pahelp sana ako kahit clue lang sana.
yung program po na ginagawa ko pag 3 beses mali input ni user na password mag cloclose ang program pero walang database
ito po yung code na nagawa ko
Status: UPDATED not working
yung program po na ginagawa ko pag 3 beses mali input ni user na password mag cloclose ang program pero walang database
ito po yung code na nagawa ko
Status: UPDATED not working
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form action="" method="post">
<h1>Secuity Password Verification</h1>
<input type="password" name="pass" required="">
<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
<?php
$attempts = 0;
if (isset($_POST['submit'])) {
if ($attempts == 3) {
echo "SORRY WRONG Password, GOODBYE!";
}
else{
$pass = $_POST['pass'];
if (strtolower($pass) == 'admin') {
echo "HELLO MY NAME IS KRISTAN MARKO CRISOSTOMO, I'M THE PROGRAMMER";
}
else{
$attempts++;
$reattempt = 3 - $attempts;
echo "Wrong Password, number of attempts left: ".$reattempt;
}
}
}
?>
Last edited: