i'm using a simple text document that holds a password in my site directory public_html/USERS/Matt/password.txt now the issue i'm having with my code is that when my submit button is pressed nothing seems to be happening. I'm sure it's just a silly mistake, anyone have any ideas here?
<?php
ob_clean();session_start();
if (isset($_GET['logout'])){
session_destroy();
}
$Username = $_POST['username'];
$EnteredPassword = $_POST['password'];
if (isset($_POST['submit'])){
if (is_dir("USERS/".$Username) === true){
$myFile=fopen("USERS/".$Username."/Password.txt","r") or exit("Can't open file!");
$CorrectPassword = fgets($myFile);
fclose($myFile);
echo 'Username found.';
if ($CorrectPassword == $EnteredPassword){
echo 'Login successful.';
}
else {
echo 'Password incorrect.';
}
}
else {
echo 'Username not found.';
}
echo 'Checking if username is found...';
}
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project Archive - Login</title>
<link href="CSS/master.css" rel="stylesheet" type="text/css">
<script src="JAVASCRIPT/respond.min.js"></script>
</head>
<body>
<div id="containerDiv">
<div id="titleDiv">
<font size="20pt">
<p align="center">Project Archive</p>
</font>
<div id="loginBoxDiv">
<form method="post" action="index.php">
<div id="username">
<p>Username:</p>
<input type="text" name="username" size="12">
</div>
<div id="password">
<p>Password:</p>
<input type="password" name="password" size="12">
</div>
<div id="btnLogin">
<input id="button" type="submit" value="Login">
</div>
</form>
</div>
</div>
</div>
</body>
</html>