3
I am trying to create a website that has a page, where the user needs to enter a password, after entering the password, if correct it redirects the user to a home page, otherwise it displays an error message, I do not know exactly what is going wrong, since when I click the button I just get redirected to the php page that appears soon to msg error.
Index form.html:
<form id="formPassword" action="php/verificar.php" method="POST">
                   
<label for="password">Password:</label>
<input id='password' type='password' name="password" size='15' maxlength='15' onfocus="value=''"/>
<br>
<br>
                               
<input id='button' src='images/enter_button.png' onmouseover="this.src='images/enter_button_hover.png'" onmouseout="this.src='images/enter_button.png'" alt='Enter' type='image' width='150px' height='30px'/>
</form>
php page:
<!DOCTYPE html>
<html lang="en">
<head>
<title>
</title>
</head>
<body>
<?php
$password = $_POST['password'];
if($password=="senha"){
include("home.php");
}else{
echo "<p>Username or Password not entered correctly please try again.</p>";
}
?>
</body>
</html>
here the html code:
– Kappa