I am making an authentication form on HTML and trying to link it up with PHP. The HTML code is
<!DOCTYPE html>
<html>
<head>
<title>Authorized logged in</title>
</head>
<div id = "adminBoard">
<form method = "POST" action = "auth.php">
<input type="text" class = "credentialInputL" name="loginInput" value = "login" size = 30>
<input type="password" class = "credentialInputP" name="passwordInput" value = "pass" size = 30>
<input class="loginLogoutButton" type = "submit" value = "Sign in" name="loginLogout">
</form>
</div>
</body>
</html>
The corresponding auth.php file (that I made to ensure basic working of POST method before expanding it) is:
<?php
if (isset($_POST['loginInput']) && isset($_POST['passwordInput'])){
$username = $_POST['loginInput'];
$password = $_POST['passwordInput'];
echo "The username is :" . $username;
echo "The password is :" . $password;
}
?>
But when I open the HTML file in chrome, and click on the Sign in button, then the auth.php file simply gets downloaded. No action takes place. Both the html and php files are in the same folder.
Am I missing some syntax / operator / method?