I've fixed the issue from it being ignored, but now i have a new issue its related to the actual information.... When you input incorrect information it gives the error stated in the code, BUT when you give correct information it reloads the page and ignores the data (I've added the PHP)
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'ajax_login');
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
session_start();
if(isSet($_POST['login-uid']) && isSet($_POST['login-pwd']))
{
$username = mysqli_real_escape_string($db,$_POST['login-uid']);
$password = mysqli_real_escape_string($db, hash('whirlpool',$_POST['login-pwd']));
$result = mysqli_query($db, "SELECT uid FROM users WHERE AccountName='$username' and AccountPassword='$password'");
$count = mysqli_num_rows($result);
$row=mysqli_fetch_array($result,MYSQLI_ASSOC);
if($count == 1)
{
$_SESSION['AccountUID'] - $row['uid'];
echo $row['uid'];
}
}
?>
<!DOCTYPE html>
<html class="bg-black">
<head>
<meta charset="UTF-8">
<title>Account Management</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="css/AdminLTE.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.ui.shake.js"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/jquery-2.1.1.js" type="text/javascript"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
$( document ).ready(function() {
$( "#login_con" ).click(function( event ) {
var UsernameString = $("#LoginUsername").val();
var PasswordString = $("#LoginPassword").val();
var FinalString = 'username='+UsernameString+'&password='+PasswordString;
if($.trim(UsernameString).length > 0 && $.trim(PasswordString).length > 0)
{
$.ajax(
{
type: "POST",
url: "ajaxlogin.php",
data: FinalString,
cache: false,
beforeSend: function() { $('#login_con').val('Processing....');},
success: function(data)
{
if(data)
{
alert("Testing");
}
else
{
alert("Incorrect information");
}
}
});
} else {
}
});
});
</script>
</head>
<body class="bg-black">
<!--
<div class="form-box" id="login-box">
<div class="header">Sign In</div>
<form>
<div class="body bg-gray">
<div class="form-group">
<input type="text" name="login-uid" class="form-control" placeholder="Account Name" id="accountname"/>
</div>
<div class="form-group">
<input type="password" name="login-pwd" class="form-control" placeholder="Password" id="accountpassword"/>
</div>
</div>
<div class="footer">
<button class="btn bg-olive btn-block" id="login_con"><< Continue >></button>
<a href="">Forgotten Passwords?</a><br>
<a href="register.html" class="text-center">Register a new membership</a>
</div>
</form>
<div class="margin text-center">
<span>Sign in using social networks</span>
<br/>
<button id="Buttons_F" class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>
<button id="Buttons_T" class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>
<button id="Buttons_G+" class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>
</div>
</div>
-->
<div class="form-box" id="box">
<div class="header">Account Management</div>
<form action="" method="post">
<div class="body bg-gray">
<div class="form-group">
<input type="text" class="form-control" placeholder="Username" id="LoginUsername"/>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" id="LoginPassword"/>
</div>
</div>
<div class="footer">
<button class="btn bg-olive btn-block" id="login_con"><< Continue >></button>
</div>
</form>
</div>
</body>
</html>