daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. error_reporting(E_ALL);
  3. $server="192.168.1.14";
  4. $user="root";
  5. $pass="iacopo9000";
  6. $connect=mysql_connect($server, $user, $pass);
  7. if (!$connect) {
  8. echo "Failed to connect to MySQL DB: ".mysql_error();
  9. die();
  10. }
  11.  
  12. $scelta = $_GET['scelta'];
  13. print "<html>
  14. <head>
  15. <title>Tool Ban/Sban-Created By skerno</title>
  16. </head>
  17. <body>
  18. <center><h2>Tool Ban/Sban By skerno A.K.A i0wn</h></center>
  19. <form method=\"post\" action=\"?scelta=1\"
  20. Nick:<br>
  21. <input type=\"text\" name=\"nick\">
  22. <input type=\"submit\" value=\"Ban!\"><br>
  23. <hr>
  24. <form method=\"post\" action=\"?scelta=2\"
  25. Id:<br>
  26. <input type=\"text\" name=\"id\">
  27. <input type=\"submit\" value=\"UnBan!\">
  28. </body>
  29. <html>";
  30. if (isset($_POST['nick']) && isset($_POST['id']) && $scelta==1) {
  31. $nick=$_POST['nick'];
  32. ban($nick,$connect);
  33. }
  34. if (isset($_POST['nick']) && isset($_POST['id']) && $scelta==2) {
  35. $id=$_POST['id'];
  36. unban($id,$connect);
  37. }
  38. if (isset($_POST['nick']) && isset($_POST['id']) && $scelta>2 or $scelta <0) {
  39. echo "Scelta invalida!";
  40. }
  41. //Functions
  42. function ban($nick,$connect){
  43.     $query="UPDATE account SET status='Banned' WHERE login='".$nick."'";
  44.     mysql_select_db("account");
  45.     mysql_real_escape_string(mysql_query($query)) || die("Failed to perform specified query: ".mysql_error());
  46.     print "<br><br><center>Account Banned!</center>";
  47.     mysql_close($connect);
  48. }
  49. function unban($id,$connect){
  50.     $query="UPDATE account SET status='OK' WHERE id='".$id."'";
  51.     mysql_select_db("account");
  52.     mysql_real_escape_string(mysql_query($query)) || die("Failed to perform specified query: ".mysql_error());
  53.     print "<br><br><center>Account UnBanned!</center>";
  54.     mysql_close($connect);
  55. }
  56. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top