Advertisement
abderrahman_bouichou

Untitled

Feb 28th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2. $fname = filter_input(INPUT_POST, 'firstName');
  3. $lname = filter_input(INPUT_POST, 'lastName');
  4. $email = filter_input(INPUT_POST, 'eventEmail');
  5. $mobile = filter_input(INPUT_POST, 'pNumber');
  6.  
  7. if (!empty($fname)){
  8. if (!empty($lname)){
  9. if (!empty($email)){
  10. if (!empty($mobile)){
  11. $host = "localhost";
  12. $dbusername = "root";
  13. $dbpassword = "";
  14. $dbname = "attendee";
  15. $port="3307";
  16. // Create connection
  17. $conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
  18. if (mysqli_connect_error()){
  19. die('Connect Error ('. mysqli_connect_errno() .') '. mysqli_connect_error());
  20. }
  21. else {
  22. $sql = "INSERT INTO badge (fname,lname, email,mobile) values ('$fname','$lname', '$email', '$mobile')";}
  23. if ($conn->query($sql)){
  24. echo'hna code html ila bghiti ';
  25. //wla diri
  26. include("path lfile li bghiti");
  27.  
  28. }
  29. else{
  30. echo "Error: ". $sql ."". $conn->error;
  31. }
  32. $conn->close();
  33.  
  34. }
  35. else {
  36. echo "Please enter your mobile number";
  37. die();
  38. }
  39.  
  40. }
  41. else {
  42. echo "Please enter your email";
  43. die();
  44. }
  45.  
  46. }
  47. else {
  48. echo "Last name should not be empty";
  49. die();
  50. }
  51.  
  52. }
  53.  
  54. else {
  55. echo "Username should not be empty";
  56. die();
  57. }
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement