Advertisement
Guest User

skrypt.js

a guest
Feb 3rd, 2017
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $(document).ready(function() {
  2. $('#lognavbtn').click(function() {
  3. var login = $('#login').val();
  4. var haslo = $('#haslo').val();
  5. var datastring = 'login='+login+'&haslo='+haslo;
  6. if($.trim(username).length>0 && $.trim(password).length>0)
  7. {
  8. $.ajax({
  9. type: "POST",
  10. url: 'https://MOJA-DOMENA.pl/libs/php/hndlrs/loginindextest.php',
  11. data: dataString,
  12. cache: false,
  13. beforeSend: function() {
  14. $('#formbox').fadeOut(500);
  15. },
  16. success: function(dane) {
  17. if(dane.responseText == "ok")
  18. {
  19. window.location.href = "logged.php";
  20. }
  21. else
  22. {
  23. $('#formbox').fadeIn(250);
  24. alert('Podano złe dane!');
  25. }
  26. },
  27. error: function() {
  28. alert('Błąd w przesyłaniu danych!');
  29. },
  30.  
  31. });
  32. }
  33. else {
  34. alert('Proszę wpisać dane!');
  35. }
  36. });
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement