Guest User

Untitled

a guest
Feb 28th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1.  
  2. $(document).ready(function()
  3. {
  4.  
  5. $('#dash_button').click(function()
  6. {
  7. var username = $('#username').val();
  8. var password = $('#password').val();
  9. $('#dummy_div').empty();
  10.  
  11. $.ajax({
  12. type:'Post',
  13. cache: false,
  14. url: 'ajax_check.php',
  15. data: {username:username,password:password},
  16.  
  17. success:function(html)
  18. {
  19.  
  20. if(html=="ADMIN")
  21. {
  22.  
  23. $.ajax({
  24. type:'Post',
  25. cache: false,
  26. url: 'adminnew.php',
  27. success:function(html)
  28. {
  29. $('#dummy_div').html(html);
  30. // $('#dummy_div').html(html).hide();
  31. // $('#dummy_div').show();
  32.  
  33. // $('#admin').html(html);
  34. }
  35.  
  36. });
  37. }
  38. if(html=="SUPERADMIN")
  39. {
  40.  
  41. $.ajax({
  42. type:'Post',
  43. cache: false,
  44. url: 'superadmin.php',
  45. success:function(html)
  46. {
  47.  
  48. $('#dummy_div').html(html);
  49. }
  50.  
  51. });
  52. }
  53. if(html=="Normal User")
  54. {
  55.  
  56. $.ajax({
  57. type:'Post',
  58. cache: false,
  59. url: 'dash.php',
  60. success:function(html)
  61. {
  62.  
  63. $('#dummy_div').html(html);
  64. }
  65.  
  66. });
  67. }
  68.  
  69. }
  70.  
  71.  
  72.  
  73.  
  74. });
  75. });
  76. });
Add Comment
Please, Sign In to add comment