The problem I'm having is that the line = header('location: loggedin.php'); is not bringing jumping to the loggedin page when I enter the correct Username and pword. Can someone see where my problem is?
<?php
$error = '';
session_start();
//connect to db
$connectdb = mysql_connect("","","");
//select database
$selectdb = mysql_select_db("") or die ("Unable to select database");
if(isset($_POST['login']))
{
$username = $_POST['username-input'];
$password = ($_POST['password-input']);
//Select Username and Password in the database
$login ="SELECT * FROM Jobseeker WHERE (Username = '$username') and (Password = '$password')";
mysql_query($login) or die(mysql_error());
//check if user input matches the database
$numrows=mysql_num_rows($login);
if ($num_rows == 1)
{
$_SESSION['username'] = $_POST['username-input'];
//Jump to loggedin page
header('Location: loggedin.php');
}
else
{
header('Location: userlogin.php');
$error = 'Error: Incorrect username or password';
}
}
?>