This is the code that I currently have. This is redirecting to a page that tells the user that the login information is incorrect. Upn submission of the UN/PW would it be better for it to stay on the login page with error script, and if so how would I do that?
<?php
session_start();
include 'dbConnection.php';
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];
$sql = "SELECT * FROM userdb WHERE uid='$uid' and pwd='$pwd'";
$result = mysqli_query($conn, $sql);
if (!$row = mysqli_fetch_assoc($result)) {
echo "Your username or password is incorrect!";
echo "Please try again!"."<br><br>";
echo "<button type='reset'>RESET";
if (isset($_POST['reset'])) {
header("Location: login.php");
echo "</button>"; }
}else {
$_SESSION['id'] = $row['id'];
}