Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4.  
  5. <form action="conn.php" method="POST">
  6. Name:<input type="text" name="name"><br/>
  7. Email Id:<input type="email" name="email"> <br/>
  8. Phone Number:<input type="number" name="phone"> <br/>
  9. <input type="submit" value="Submit">
  10. </form>
  11.  
  12.  
  13. <?php
  14. $host="localhost";
  15. $user="root";
  16. $pass="";
  17. $db="amrit";
  18.  
  19. $name=$_POST['name'];
  20. $email=$_POST['email'];
  21. $phone=$_POST['phone'];
  22.  
  23. $conn = mysqli_connect($host, $user,$pass,$db);
  24.  
  25. $query = "insert into data('Name','Email','Phone') values('$name','$email','$phone')";
  26.  
  27. $result= mysqli_query($conn,$query);
  28.  
  29. if($result==TRUE){
  30. echo "Data Inserted";
  31. }
  32. else{
  33. echo "Error";
  34. }
  35. mysqli_close($conn);
  36. ?>
  37.  
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement