toribio

toribio

Jul 2nd, 2009
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. //kick.php:
  2. <?
  3. if(getenv("REQUEST_METHOD") == "POST")
  4. {
  5.    $nome = $_POST['nome'];
  6.    $reason = $_POST['reason'];
  7.  
  8.    if($nome and $reason)
  9.    {
  10.       $conexao = mysql_pconnect("host", "user", "senha");
  11.       mysql_select_db("database", $conexao);
  12.       $nome = mysql_real_escape_string($nome);
  13.       $reason = mysql_real_escape_string($reason);
  14.       $query = "UPDATE `users` SET `kick` = 1, `kickreason` = '$reason' WHERE `nick` = '$nome'";
  15.       mysql_query($query, $conexao);
  16.       header("Location: ler.php");
  17.    } else {
  18.       $err = "Preencha todos os campos!";
  19.    }
  20. }
  21.  
  22. ?>
  23. <html>
  24. <head>
  25.    <title>Kick Remoto</title>
  26. </head>
  27. <body>
  28. <?
  29. if($err)
  30. {
  31.    ?>
  32.    <ul><font color="red"><? echo $err; ?></font></ul>
  33.    <?
  34. }
  35. ?>
  36.  
  37. <form method="post" action="kick.php"> <!-- lembre-se de mudar o nome do arquivo -->
  38. <table border="0">
  39. <tr>
  40.    <td>Nome exato: </td>
  41.    <td><input type="text" size="15" name="nome" maxlength="24"></td>
  42. </tr>
  43. <tr>
  44.    <td>Razão: </td>
  45.    <td><input type="text" size="30" name="reason" maxlength="64"></td>
  46. </tr>
  47. </table>
  48. <input type="submit" value="Kickar">
  49. </form>
  50. </body>
  51. </html>
Add Comment
Please, Sign In to add comment