Wizard Registration Form with Progress Bar

In this tutorial, we are going to create registration form using PDO in PHP. If you are looking for Wizard Registration Form with Progress Bar then you are at the right place. Using this kind of form, you can organize the information to be enter by the user. This simple tutorial, it has 3 steps to finish the registration for the user. To create this simple registration form, kindly follow the steps in this tutorial Form Wizard with Progress Bar in Admin Bootstrap to have a Wizard Registration Form. All we have to do is to create q PHP query to insert data on the database using PDO. These simple variables that we are going to use to get the data in the wizard registration form.
  1. <?php
  2. $user_first_name = $_POST['user_first_name'];
  3. $user_last_name = $_POST['user_last_name'];
  4. $user_code_number = $_POST['user_code_number'];
  5. $user_type = $_POST['user_type'];
  6. $user_status = 'Active';
  7. $date_added = date('Y-m-d H:i:s a', strtotime('+6 hour'));
  8. ?>
Here, in this query, where the information from the user will process to save into the database using the INSERT Statement.
  1. <?php
  2. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  3. $insert_query = "INSERT INTO tbl_user (user_first_name, user_last_name, user_code_number, user_type, user_status, user_date_added)
  4. VALUES (?, ?, ?, ?, ?, ?)";
  5. $insert = $conn->prepare($insert_query);
  6. $insert->execute(array(
  7. $user_first_name,
  8. $user_last_name,
  9. $user_code_number,
  10. $user_type,
  11. $user_status,
  12. $date_added
  13. ));
  14. ?>
And, this is the full source code to complete the insert data query into the database. Check the source code below and study. Enjoy coding.
  1. <?php
  2. require_once ('include/database.php');
  3.  
  4. if (isset($_POST['submit_member']))
  5. {
  6. $user_first_name = $_POST['user_first_name'];
  7. $user_last_name = $_POST['user_last_name'];
  8. $user_code_number = $_POST['user_code_number'];
  9. $user_type = $_POST['user_type'];
  10. $user_status = 'Active';
  11. $date_added = date('Y-m-d H:i:s a', strtotime('+6 hour'));
  12. {
  13. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  14. $insert_query = "INSERT INTO tbl_user (user_first_name, user_last_name, user_code_number, user_type, user_status, user_date_added)
  15. VALUES (?, ?, ?, ?, ?, ?)";
  16. $insert = $conn->prepare($insert_query);
  17. $insert->execute(array(
  18. $user_first_name,
  19. $user_last_name,
  20. $user_code_number,
  21. $user_type,
  22. $user_status,
  23. $date_added
  24. ));
  25. echo "<script>alert('New Member successfully added!'); window.location='add-members.php'</script>";
  26. }
  27. }
  28. ?>
If you have a question regarding this simple tutorial, leave a comment below. Click the download code button below to get the full source code. Enjoy coding. Thank you.

Add new comment