Advertisement
Guest User

Untitled

a guest
Feb 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2. $id = $_GET["id"];
  3.  
  4. $servername = "localhost";
  5. $username = "root";
  6. $password = "";
  7.  
  8. $con=mysqli_connect($servername,$username,$password,"rubrica");
  9.  
  10. if (mysqli_connect_errno())
  11.   {
  12.   echo "Connessione non riuscita: " . mysqli_connect_error();
  13.   }
  14.   else
  15.   {
  16.      $sql="DELETE FROM contatto WHERE id = ". $id ."";
  17.      $result = mysqli_query($con,$sql);
  18.   }
  19.   header("Location: index.php");
  20. ?>
  21.  
  22. <?php
  23. $nome = $_GET["nome"];
  24. $cognome = $_GET["cognome"];
  25. $telefono = $_GET["telefono"];
  26. $codiceFiscale = $_GET["codice_fiscale"];
  27.  
  28. $servername = "localhost";
  29. $username = "root";
  30. $password = "";
  31.  
  32.  
  33.  
  34. $con=mysqli_connect($servername,$username,$password,"rubrica");
  35.  
  36. if (mysqli_connect_errno())
  37.   {
  38.   echo "Connessione non riuscita: " . mysqli_connect_error();
  39.   }
  40.   else
  41.   {
  42.      $sql="INSERT INTO contatto (codice_fiscale, nome, cognome, telefono) VALUES ('". $codiceFiscale ."', '". $nome ."','". $cognome ."','". $telefono ."')";
  43.      $result = mysqli_query($con,$sql);
  44.   }
  45.   header("Location: index.php");
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement