Advertisement
Guest User

Code Kuno

a guest
Apr 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php //Query
  2. $Naam = $_POST['Naam'];  
  3. $Email = $_POST['Email'];  
  4. $Adres = $_POST['Adres'];  
  5. $tel = $_POST['tel'];  
  6. $Reason = $_POST['Reason'];  
  7. $quest = $_POST['quest'];  
  8.  
  9.  
  10. //Verbinden
  11. $username = "root";
  12. $password = "";
  13. $hostname = "localhost";
  14. $db = "jd";
  15.  
  16. //connection to the database
  17. $dbhandle = mysqli_connect($hostname, $username, $password, $db)
  18.   or die("Unable to connect to MySQL");
  19. echo "Connected to MySQL<br>"
  20.    
  21.  //INSERT
  22.  $query = " INSERT INTO Contact (Naam, E-mail, Adres, Telefoon / Gsm, Waarom?, Vraag)  VALUES ('$Naam', '$Email', '$Adres', '$tel', '$Reason', '$quest') ";
  23.  $result = mysql_query($query);
  24.  
  25.  if( $result )
  26.  {
  27.     echo 'Success';
  28.  }
  29.  else
  30.  {
  31.     echo 'Query Failed';
  32.  }
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement