A user is able to Register their account but nothing happens (no errors appear, no redirection after login) when I submit a registered users information.
I've posted my form partial code down below as well as my Login.php file if anyone could help me out? I've played around with the code to see if there was anything specific blocking the functionality of the page but nothing seems to make a difference
Login Form
<body>
<div align = "center" ><p style="margin-top: 100px;">
<div class="col-lg-4 mb-4">
<div class="card h-100">
<h4 class="card-header"><font face = "Lucida
Handwriting">Login</font></h4>
<form method="post" action="<?php echo
htmlspecialchars($_SERVER["PHP_SELF"]);?>"><b
<p style="margin-top: 50px;"></p>
<span class="error">* <?php echo $email_addressErr;?></span>
Email Address:<br><input type="text"
name="email_address"
value="<?php echo $email_address;?>"><br>
<span class="error">* <?php echo $acc_passwordErr;?></span>
Password:<br><input type="text" name="acc_password"
value="
<?php echo $acc_password;?>"><br>
<br><p style="margin-top: 30px;"></p>
<input type ="submit" value="submit" name="Sign-In"
href="Main.php"></p>
</form>
</div>
</div>
</div>
</body>
Main page
<html lang="en">
<?php
include 'Assets/Partials/Header.php'
?>
<?php
//start session
session_start();
//if userSession is set
if ( isset($_SESSION['userSession'])!="" )
{
header("Location: Main.php");
}
require_once 'DBConnect.php';
//initialising variables
$email_address = "";
$acc_password = "";
//if login button is clicked
if (isset($_POST['Sign-In']) )
{
//Following 3 lines commented out and they weren't doing
anything
//$email_address = strip_tags($_POST['email_address']);
//$email_address = $mysqli->strip_tags($_POST['email_address']);
// $acc_password = strip_tags($_POST['acc_password']);
$email_address = $DBcon->mysqli_real_escape_string($DBcon,
$_POST['email_address']);
$acc_password = $DBcon->mysqli_real_escape_string($DBcon,
$_POST['acc_password']);
//select user details where email matches email field
$query = $DBcon->query("SELECT customer_id FROM customer WHERE
email_address='$email_address' and acc_password =
'$acc_password'");
$result = mysqli_query($DBcon, $query);
$row = mysqli_fetch_arry($result, MYSQLI_ASSOC);
$active = $row['active'];
//see if row is returned
$count = mysqli_num_rows($result);
//if row is returned and hashed password is verified, set
session
if ( password_verify($acc_password, $row['acc_password']) &&
$count==1 )
{
$_SESSION['userSession'] = $row['customer_id'];
header("Location: Main.php");
}
//else notify user that email or password is incorrect
else
{
echo"<script>alert('Your Email Address and/or Password is
invalid')</script>";
}
//close connection
$DBcon->close();
}//End If
?>
<body>
<?php
include 'Assets/Partials/IndexMenu.php'
?>
<?php
include 'Assets/Partials/LoginForm.php'
?>
</body>
</html>
` but you have only typed ` – Lordbug Apr 10 '18 at 14:22