• We just launched and are currently in beta. Join us as we build and grow the community.

Wizard Registration Form with Progress Bar

john11

DAO Coordinator
J Rep
0
0
0
Rep
0
J Vouches
0
0
0
Vouches
0
Posts
212
Likes
133
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 200 XP
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. if

    (

    isset

    (

    $_POST

    [

    'submit_member'

    ]

    )

    )
  4. {
  5. $user_first_name

    =

    $_POST

    [

    'user_first_name'

    ]

    ;
  6. $user_last_name

    =

    $_POST

    [

    'user_last_name'

    ]

    ;
  7. $user_code_number

    =

    $_POST

    [

    'user_code_number'

    ]

    ;
  8. $user_type

    =

    $_POST

    [

    'user_type'

    ]

    ;
  9. $user_status

    =

    'Active'

    ;
  10. $date_added

    =

    date

    (

    'Y-m-d H:i:s a'

    ,

    strtotime

    (

    '+6 hour'

    )

    )

    ;
  11. {
  12. $conn

    ->

    setAttribute

    (

    PDO::

    ATTR_ERRMODE

    ,

    PDO::

    ERRMODE_EXCEPTION

    )

    ;
  13. $insert_query

    =

    "INSERT INTO tbl_user (user_first_name, user_last_name, user_code_number, user_type, user_status, user_date_added)
  14. VALUES (?, ?, ?, ?, ?, ?)"

    ;
  15. $insert

    =

    $conn

    ->

    prepare

    (

    $insert_query

    )

    ;
  16. $insert

    ->

    execute

    (

    array

    (
  17. $user_first_name

    ,
  18. $user_last_name

    ,
  19. $user_code_number

    ,
  20. $user_type

    ,
  21. $user_status

    ,
  22. $date_added
  23. )

    )

    ;
  24. echo

    "<script>alert('New Member successfully added!'); window.location='add-members.php'</script>"

    ;
  25. }
  26. }
  27. ?>

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.


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,348

323,357

Top