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(){
- $.post('/assets/inc/login.php', {
- username: $('[name=username]').val(),
- password: $('[name=password]').val()
- },
- function(data) {
- // The password/username is correct
- if(data.success){
- $('span.username').text(data.user);
- $('#login_wrap').fadeOut('1500');
- $('#login_success').load('success.php').delay('1000').fadeIn('1500');
- }
- // Password/username was incorrect
- else{
- $('#login_error').show();
- }
- }, 'json');
- // Returns false to prevent updating of page
- return false;
- });
- });
Add Comment
Please, Sign In to add comment