I’m creating a transactional website for my ICT coursework, and I am making it on Adobe Dreamweaver using PHP, Javascript, and CSS. This is my login.php and, when the ‘submit’ button is pressed, should take the user to the signin.php page.
Here is my login.php:
<?php
session_start();
if (!empty($_SESSION["username"])){
header("Location: ./account");
}
include('header.php'); ?>
<main class="container">
<div class="mb-4" style="background-color: #653f97;">
<!-- Login Form -->
<div class="p-4">
<p><span style="color:red; text-align: center;"><?php
if(!empty($_SESSION["signinError"])){
echo $_SESSION["signinError"]; }?></span></p>
<form action="./signin" method="post" id="signin">
<div class="form-outline mb-4">
<input type="username" name="username" id="usernameInput" class="form-control" />
<label class="form-label" for="usernameInput">Username</label>
</div>
<div class="form-outline mb-4">
<input type="password" name="password" id="passwordInput" class="form-control" />
<label class="form-label" for="passwordInput">Password</label>
</div>
<input type="submit" class="btn btn-primary btn-block mb-4" />
</form>
<div class="row">
<div class="text-left">
<a href="./forgotPassword">Forgot Password?</a>
<p>New to Musify? <a href="./register">Register</a></p>
</div>
</div>
</div>
<?php include('footer.php'); ?>
When the ‘submit’ button is pressed, it does not redirect to http://localhost/signin, but to http://localhost/username=(the username I submitted)&password=(the password I submitted)/. No error messages appear, nothing. It just sends me back to this login.php page and does not take me anywhere. Am I stupid and is there just an error somewhere in the code that I’m not seeing?
- for reference, I have a .htaccess file (if that helps.)
1