Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. $servidor = "localhost";
  5. $usuario = "root";
  6. $senha = "";
  7. $dbname = "sistema";
  8.  
  9. //Criar a conexao
  10.  
  11. error_reporting(0);
  12. $link = new mysqli ("localhost", "root", "", "sistema");
  13. if($link->connect_errno){
  14. echo"Nossas falhas local experiência ..";
  15. exit();
  16. }
  17.  
  18. ?>
  19.  
  20. <?php
  21.  
  22. if($_SERVER['REQUEST_METHOD'] == 'POST') {
  23. $mesa=$_POST['mesa'];
  24. $nome=$_POST['nome'];
  25. $telefone=$_POST['telefone'];
  26. $data=$_POST['data'];
  27. $hora=$_POST['hora'];
  28. $sql="INSERT INTO reservar(mesa,nome,telefone,data,hora) VALUES('$mesa','$nome','$telefone','$data','$hora')";
  29. $resultado_cadastro = mysqli_query($link,$sql);
  30. }
  31.  
  32.  
  33. ?>
  34.  
  35.  
  36.  
  37.  
  38.  
  39. <form method="post" action="http://localhost/peixaria/inicio2.php?btn=entrega">
  40. <div class="reservations">
  41. <h1>Reservar:</h1>
  42.  
  43. <p>Mesa: </p>
  44. <input type="text" name="mesa" class="form" required>
  45.  
  46.  
  47. <p>Nome: </p>
  48. <input type="text" name="nome" class="form" required>
  49. <p>Telefone: </p>
  50.  
  51. <input type="text" name="telefone" class="form" required>
  52. <p>Data: </p>
  53. <input type="date" name="data" class="form" required placeholder="dd/mm/jjjj">
  54. <p>Hora: </p>
  55. <input type="time" name="hora" class="form" required placeholder="14:30">
  56.  
  57. <button type="submit" >enviar</button>
  58. </div>
  59.  
  60. <div class="thankyou">
  61. <i class="fa fa-check-square-o"></i>
  62.  
  63. </div>
  64.  
  65. <div id="dtBox"></div>
  66. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement