if ($_POST['submit'] == "Login") { extract($_POST); $textfilename = dirname(__FILE__) . "/pwd/pwd.txt"; if (!$handle = fopen($textfilename, 'r')) { exit; } $fcontent = trim(fread($handle, filesize($textfilename))); fclose($handle); //echo $textfilename; if ($pword == $fcontent) { $_SESSION['logged'] = "true"; header("Location:index.php"); } else { $error = "Invalid Password"; } } echo $error; ?> |
