Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. The following record has been added to the database:<br>
  6. <br><?php echo $_POST["forename"]; ?><br>
  7. <br><?php echo $_POST["surname"]; ?><br>
  8. <br><?php echo $_POST["mobile"]; ?><br>
  9. <br><?php echo $_POST["homemobile"]; ?><br>
  10. <br><?php echo $_POST["email"]; ?><br>
  11. <br><?php echo $_POST["street"]; ?><br>
  12. <br><?php echo $_POST["town"]; ?><br>
  13. <br><?php echo $_POST["postcode"]; ?><br>
  14. <br><?php echo $_POST["country"]; ?><br>
  15. <br><?php echo $_POST["identifier"]; ?><br>
  16.  
  17. <?php
  18. $servername = "63.223.86.80";
  19. $username = "root";
  20. $password = "password";
  21. $dbname = "Contact App";
  22.  
  23. // Create connection
  24. $conn = mysqli_connect($servername, $username, $password, $dbname);
  25. // Check connection
  26. if (!$conn) {
  27. die("Connection failed: " . mysqli_connect_error());
  28. }
  29.  
  30. $sql = "INSERT INTO CONTACTS (Forename, Surname, Mobile, Home Mobile, E-mail, Street, Town, Post Code, Country, Group Identifier)
  31. VALUES (forename, surname, mobile, homemobile, email, street, town, postcode, country, identifier)";
  32.  
  33. if (mysqli_query($conn, $sql)) {
  34. echo "New record created successfully";
  35. } else {
  36. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  37. }
  38.  
  39. mysqli_close($conn);
  40. ?>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement