Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

  Email validation using regular expression php

Here is a php script to validate email address. We are using regular expression for validation.
Cut & Paste Script
<html>
<head><title></title></head>
<body>
<?php

if (isset($_POST['posted'])) {

   $email = $_POST['email'];
   $theresults = ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email);
   if ($theresults) {
      $message= "Valid";
   } else {
      $message= "Invalid";
   }

   echo "Email address validation says $email is " . $message;
}

?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="hidden" name="posted" value="true">
Enter your email address for validation:
<input type="text" name="email" value="myemail@domain.com">
<input type="submit" value="submit">
</form>
</body>
</html>
 
   
     RELATED SCRIPTS
 
creating new table in MySql using php
Here is an example to create a new table in mysql database....more »
Category : PHP Examples Hits : 656
   
creating xml file using php
Here is a script to create xml file using php DOM....more »
Category : PHP Examples Hits : 554
   
Exporting data from MySql table to CSV using PHP
Here is a code example for exporting data from MySql table to a CSV File. CSV file format is a file type that stores tabular data usually processed in applications like Microsoft Excel....more »
Category : PHP Examples Hits : 1469
   
Comparing two arrays using php
This code example will take two arrays and compares 2nd array with 1st. It will show the list of elements which are not found in the first array....more »
Category : PHP Examples Hits : 649
   
Uploading file using php
Here is a simple script to upload file using php. we are using move_uploaded_file function to upload file. The move_uploaded_file function needs two parameters
1. The path of the temporary file.
2. The path where it is to be moved to.
...more »
Category : PHP Examples Hits : 429
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Structure and Interpretation of Computer Programs  Ebook Structure and Interpretation of Computer Programs
   
Download  Squeeze Page Secrets Ebook Squeeze Page Secrets
   
Download Landing Page Success Guide  Ebook Landing Page Success Guide
   
Download Supercharged eBook Creation Leaked Chapter  Ebook Supercharged eBook Creation Leaked Chapter
   
Download Essentials of the Java Programming Language: A Hands-On Guide  Ebook Essentials of the Java Programming Language: A Hands-On Guide
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz