Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('#Submit').click(function() {
- $.ajax({
- type : 'POST',
- url : './helpers/checkuser.php',
- data: {
- action: "checklogin",
- user : $('#username').val(),
- pass : $('#password').val()
- },
- success:function (data) {
- if (data == "Valid Login")
- window.location.replace("../login.php");
- else
- alert(data);
- }
- });
- });
- });
- // QUERY THE DB
- $stmt = $link->prepare('SELECT * FROM users WHERE username = '$username' AND password = '$password'');
- $stmt->bind_param('s', $search);
- $stmt->execute();
- $result = $stmt->get_result();
- if(mysqli_num_rows($result) > 0)
- {
- echo "Valid Login";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement