Advertisement
Guest User

enterorder

a guest
Jan 3rd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <?PHP
  10.  
  11. $dbhost = "localhost";
  12. $dbuser = "workshe3_test";
  13. $dbpass = "cats8000";
  14. $dbname = "workshe3_test";
  15.  
  16. $conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);
  17.  
  18. if(!$conn)
  19. {
  20. die("Connection failed: " . mysqli_connect_error());
  21. }
  22. $first = $_POST["first"];
  23. $last = $_POST["last"];
  24. $phone = $_POST["phone"];
  25. $address = $_POST["address"];
  26. $toppings = $_POST["toppings"];
  27. $size = $_POST["size"];
  28. $pickUpTime = $_POST["pickUpTime"];
  29. $ConfirmNum = $_POST["ConfirmNum"];
  30. $sql = "INSERT INTO orders (first, last, phone, address, toppings, size, pickUpTime, ConfirmNum) VALUES ('$first', '$last', '$phone', '$address', '$toppings', '$size', '$pickUpTime', '$ConfirmNum')";
  31.  
  32. if (mysqli_query($conn, $sql))
  33. {
  34. echo "New post created successfully";
  35. Redirect('Confirmation.php');
  36. }
  37. else
  38. {
  39. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  40. }
  41.  
  42. mysqli_close($conn);
  43. ?>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement