Email Address Confirmation PHP Tutorial

If you want that users sign up to join your website you may want to verify their email address by sending confirmation link to their email address. You’ll learn how to do this in this tutorial.


Following files will be use in this process of email confirmation.

PHP files
1. signup.php
2. signup_ac.php
3. confirmation.php
4. config.php

DB files
1. members_db_temp
2. reg_members

1. When users will be sign up. Random a set of confirmation code will be generate.
2. Keep all confirmation code and informations in table "members_db_temp". This table will be temporary, we have to move this informations to table "reg_members" after email address has been verified.
3. After sucessfully inserted data into table "temp_membes_db", send confirmation link to email that users used to sign up, if email will be invalid they will not receive our email.
4. They have to click on confirmation link to activate their account. (move data from table "temp_member_db" to table "reg_members" and delete data from table "members_db_temp" in this step)


Create table "members_db_temp" and table "reg_members"

Table "members_db_temp"

Table "reg_members"


Create sign up form (signup.php)


Insert data into database (signup_ac.php)

In this step
1. Random confirmation code
2. Insert data and confirmation code into database
3. Send email to user with confirmation link

After successfully inserted data into database send confirmation link to Dev’s email "$confirm_code"

|—|——————— code ——————–|—|

// —————- SEND MAIL FORM —————-



When jack open his email he’ll see this message and link to file "confirmation.php" including passkey in url.

In this step
1. Check passkey
2. If found passkey in database, move all data in that row from table "members_db_temp" to table "reg_members"
3. Delete passkey from table "members_db_temp"

|—|——————— code ——————–|—|


config.php – config your database

  1. Tutorial Lounge Reply

Leave a Reply

Your email address will not be published. Required fields are marked *