Hmm unfortunately i am still having a problem. No errors but it is not doing what its supposed to do.
Here is my updated code -
<?php
require_once("db/connect.php");
session_start();
//Field Data
if (isset($_POST['userid'], $_POST['password'], $_POST['submit'])){
$userid = $_POST['userid'];
$password = $_POST['password'];
$submitted = $_POST['submit'];
if ($userid && $password){
//////////////////////////////////////////////////
$query = sprintf("SELECT * FROM users WHERE user_name='$userid' AND user_password='$password'");
$result = @mysql_query($query);
$rowAccount = @mysql_fetch_array($result);
//////////////////////////////////////////////////
if ($rowAccount){
$_SESSION['id'] = $rowAccount['user_id'];
header("Location:user_area/");
exit;
} else {
echo "No user in our database!";
}
}
else
{
echo "You have not filled in all the fields";
}
}
else
{
echo "You must fill in the everything to login";
}
?>
But now say when i fill in one field and leave the other one blank then it gives me this echo -
echo "You must fill in the everything to login";
And when i fill in both fields and say that user isnt in the db which is what it should say (or something very close) if gives me the same message -
echo "You must fill in the everything to login";