IM8
Decentralized Autonomous Organization Specialist
LEVEL 1
300 XP
Email Validation Using PHP
In this tutorial, we are going to learn on Email Validation Using PHP. Using PHP scripts is safe and secure. It accepted a valid email only.
!
eregi
(
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$
Using this PHP script is only accept the valid email address.
Do you need to validate or verify an email address? To verify the validity of your email address simply enter your email address into the textbox provided and the validation tool will do the rest. Kindly click "Download Code" below to have this simple tool.
Directions:
First: Kindly copy this code to your HEAD section of your page.
Second: You have to copy this shortcode to the BODY section of your page.
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
In this tutorial, we are going to learn on Email Validation Using PHP. Using PHP scripts is safe and secure. It accepted a valid email only.
!
eregi
(
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$
Using this PHP script is only accept the valid email address.

Do you need to validate or verify an email address? To verify the validity of your email address simply enter your email address into the textbox provided and the validation tool will do the rest. Kindly click "Download Code" below to have this simple tool.
Directions:
First: Kindly copy this code to your HEAD section of your page.
- <style type=
"text/css"
>
- .container{
- border
:
2px
ridge
#CCCCCC
;
- border-radius
:
5px
;
- width
:
400px
;
- margin
:
0
auto
;
- padding
:
25px
;
- font-family
:
Verdana,
Geneva,
sans-serif
;
- font-size
:
12px
;
- float
:
left
;
- }
- .error{
- color
:
chocolate
;
- font-weight
:
bold
;
- }
- .text_style
{
- font-size
:
15px
;
- color
:
blue
;
- font-weight
:
bold
;
- }
- .text_box
{
- text-indent
:
10px
;
- width
:
200px
;
- height
:
30px
;
- border
:
2px
solid
#D9D9D9
;
- font-size
:
15px
;
- }
- .btn_style
{
- width
:
100px
;
- float
:
right
;
- margin-right
:
26px
;
- font-size
:
15px
;
- background
:
rgba
(
0
,
0
,
0
,
.6)
;
- color
:
#fff
;
- cursor
:
pointer
;
- border-radius
:
5px
;
- height
:
30px
;
- }
- </style>
Second: You have to copy this shortcode to the BODY section of your page.
- <?php
- error_reporting(
0
)
;
- if(
isset(
$_POST[
'enter'
]
)
)
{
- $email=
$_POST[
'email'
]
;
- if(
$email==
""
)
{
$err=
"* Enter your email address..."
;}
- else{
- if(
!eregi(
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"
, $email)
)
{
- $err =
"* Email Address Syntax is not correct..."
; }
- else{
$err=
"* Email Address Syntax is correct..."
;}
- }
}
?>
- <div
class
=
"container"
>
- <form
method
=
"post"
>
- <p
align
=
"center"
class
=
"error"
>
- <?php echo $err; ?>
- </
p
>
- <p
align
=
"center"
>
- <span
class
=
"text_style"
>
Enter your email</
span
>
- <input
type
=
"text"
class
=
"text_box"
name
=
"email"
placeholder=
"Email Address..."
>
- </
p
>
- <p
align
=
"center"
>
- <input
type
=
"submit"
class
=
"btn_style"
name
=
"enter"
value
=
"Check"
>
- </
p
>
- </
form
>
- </
div
>
Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at [email protected]. Practice Coding. Thank you very much.
Download
You must upgrade your account or reply in the thread to view hidden text.