Advertisement
SSYT

Ajax Ban form !

May 8th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if($('form[name="ban"] input[name="username"]').val() != "" || $('form[name="ban"] input[name="ip"]').val() != "" || $('form[name="ban"] input[name="reason"]').val() != "")
  2. {
  3.     var name = $('form[name="ban"] input[name="username"]').val();
  4.     var ip = $('form[name="ban"] input[name="ip"]').val();
  5.     $.ajax({
  6.         url: "http://cdn.openpro.ro/extrem-tutorials.com/v7.0/ban_sys/config.php",
  7.     type: 'POST',
  8.         dataType: "jsonp",
  9.         jsonpCallback: false,
  10.         jsonp: false,
  11.     crossDomain: true,
  12.         data: {
  13.             username: $('form[name="ban"] input[name="username"]').val(),
  14.             ip: $('form[name="ban"] input[name="ip"]').val(),
  15.             reason: $('form[name="ban"] input[name="reason"]').val()
  16.         },
  17.         succes: function(data) {
  18.             $('form[name="ban"]').after(name+" has been banned succesfully !");
  19.         },
  20.         error: function(data) {
  21.             $('form[name="ban"]').after(name+" has failed banned !");
  22.         }
  23.     });
  24. } else alert("Failed !");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement