Guest User

Untitled

a guest
May 4th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <script>
  2.  
  3. $(document).ready(function(){
  4. $('form').on('submit',function(){
  5. $.ajax({
  6. type:'post',
  7. url:'<?php echo base_url(); ?>users_controller/login_check',
  8. data: {
  9. username:'username',
  10. password:'password'
  11. }
  12. success:function(detail)
  13. {
  14. if(detail !== 'error')
  15. {
  16. window.location.href=detail;
  17. }
  18. else
  19. {
  20. $('.error').html('');
  21. $('.error').html('<p class="alert alert-danger">Invalid username or password</p>');
  22. $('.error').show();
  23. }
  24. }
  25. });
  26. return false;
  27. });
  28. });
  29.  
  30. </script>
Add Comment
Please, Sign In to add comment