Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- // Defines what to post to the php script
- $('form[name=login]').submit(function(){
- var action = $('#login_form').attr('action');
- var loginData = {
- username: $('#username').val(),
- password: $('#password').val(),
- loginPost: 1
- };
- // Checks if information entered is correct
- $.ajax({
- type: "POST",
- url: action,
- data: loginData,
- success: function(response)
- {
- // If information is correct, then fade in success site
- if(response == 'success')
- $('#login_success').show();
- // If information is not correct, then show error message
- else
- $('#login_error').show();
- }
- });
- return false;
- });
- });
Add Comment
Please, Sign In to add comment