Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. $reason = $_REQUEST['reason'];
  3. $nl = "</br>";
  4.  
  5.  
  6. echo "Tempo: $time" .$nl;
  7. echo "Motivo: $reason" .$nl;
  8.  
  9.  
  10. $db_host = 'localhost';
  11. $db_user = 'root';
  12. $db_pass = '';
  13. $db_name = 'lsrp';
  14.  
  15.  
  16. $cn = new mysqli($db_host, $db_user, $db_pass, $db_name);
  17.  
  18.  
  19. if ($cn->connect_errno) {
  20. echo "Connessione fallita: ". $cn->connect_error . ".";
  21. exit();
  22. }
  23.  
  24.  
  25. $sql = "INSERT INTO jail (time, reason) VALUES (" . "'" . $time . "'," . "'" . $reason . "')";
  26.  
  27.  
  28. if (!$cn->query($sql)) {
  29. echo "Errore della query: " . $cn->error . ".";
  30. }else{
  31. echo "Jail eseguito correttamente.";
  32. }
  33.  
  34.  
  35. $cn->close();
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement