So i started creating a basic website for a small project im working on. I took a 2 week break where i left everything in working condition. Decided to load up WAMP server today afternoon and as soon as i try to access my index file i get the error:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This problem can sometimes be caused by disabling or refusing to accept cookies.
This is my index code.
<?php
session_start();
require_once('../Controller/loginController.php');
if(isset($_SESSION['user_session'])){
header("location:accountSummary.php");
}
?> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" href="../Web/CSS/LoginStyle.css" type="text/css" /> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <title>Energy Checker: Login</title> </head> <body> <div id="login"> <div id="triangle"></div> <h1>Log in</h1> <form id="loginfrm" method="post"> <div id="logBtns"> <?php
if(isset($error))
{
?> <div class="loginAlert"> <?php echo $error; ?> </div> <?php
}
?> <input type="text" id="txtAcc" name ="txtAccNum" placeholder="Account Number" required/> <br> <input type="password" id="txtPass" name ="txtPassword" placeholder="Password" maxlength="8" required/> <br> <input id="btn-login" type="submit" name="btn-login" value="Login">
New User? Click <a href="register.php">here</a> to register.
</div> </form> </div> </body> </html>
My Controller code:
<?php
require_once('../Model/loginModel.php');
$user = new Login();
if(isset($_POST['btn-login']))
{
$accNum = strip_tags($_POST['txtAccNum']);
$Password = strip_tags($_POST['txtPassword']);
if($user->getLogin($accNum,$Password))
{
$user->redirect('../View/accountSummary.php');
}
else
{
$error = "Please check your login details";
}
}
?>
I have no idea whats caused this. My code hasnt changed at all. Any ideas?
Thanks!