Jump to content

VALIDATION of EMAIL-Address without JS


ashishrathore

Recommended Posts

I am not sure if this is what you are looking for but ooh wellthere it goes

$status = "OK";  $msg=""if (!stristr($em,"@") OR !stristr($em,".")) {$msg="Your email address is not correct<BR>";$status= "NOTOK";}  if($status=="OK"){ echo "your submitted email address is $The email variable if you need it<br>";    $link = mysql_connect(" l", " ", " ");// incase you are using sql   mysql_select_db("table_name");      $sql = "INSERT INTO table_name VALUES (' ')";$query=mysql_query($sql);   echo "<center><b>THANK YOU</b> </center><br>";   echo "<center>WE HAVE YOUR EMAIL ADDRESS<br>";   }       else {echo "<center>$msg </center>";  include '/inc/go_back.inc'; //html file showing a link to try again}?>  </body></html>

I HOPE I HELPED

Link to comment
Share on other sites

try this

<?phpfunction checkEmail($email) {  $pattern = "/^[A-z0-9\._-]+"         . "@"         . "[A-z0-9][A-z0-9-]*"         . "(\.[A-z0-9_-]+)*"         . "\.([A-z]{2,6})$/";  return preg_match ($pattern, $email);}if(checkEmail($your_email_address_to_be_validate)){	echo "Correct Email";}else{	echo "You have entered invalid email address";}?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...