Email Verification in PHP: Part 1

This video to illustrates, verification of user email ID by sending a unique URL to be clicked by the user inorder to active his account, to further use the application.

Use
We can restrict certain features of our application for the accounts which has not been verified.
By this we can know if the email ID is valid and authorized user is using it and no one else.

Database

mysql> create database test;
mysql> use test;
mysql> create table login(
   name varchar(25) not null, 
   pass varchar(60) not null, 
   email varchar(30) primary key,
   phn varchar(15), 
   rndm varchar(20) not null, 
   actv int not null);

Note: Do not make phno as integer, as it can’t handle huge numbers like 9844552841 (if its a phone number!)
email is concede red as Primary Key, as we can identify each user uniquely via this attribute. No two user can have the same email id.

Database connection script
db.php


Registration Code:
register.php

 

The user input will be passed to save.php via post method.

save.php


Please visit your email to activate your account
         
After Activation, log into your account'; else echo 'Registration failed..please try again'; } ?>

change yourdomainname.com to the actual domain name the application is hosted on.

md5() is a built-in function. It is a encryption technique for securing the user passwords from intruders.
rand( initialValue, finalValue) is a built-in PHP function which takes range as its parameter and generates a random number between them.

mail() is a built-in PHP function for sending emails.

General Syntax:
mail(To, Subject, Content, From)

Video Tutorial: Part 1



YouTube Link: https://www.youtube.com/watch?v=BwgOn5sbK4c [Watch the Video In Full Screen.]



Also look at: Email Verification in PHP: Part 2

You can purchase this simple script directly for as less as $1.95 get here.



View Comments