Jump to content

Email Validation


Terfanda

Recommended Posts

function emailcheck($Email)
{
if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email))
{
$ans1=FALSE;
}
else
{
$ans1= TRUE;
}
return $ans1;

}




Hello agian I will be very thankfull if someone help I am using this function up it seems it is wrong can someone tells me where is my mistake

i am calling it here:::::: $acc=emailcheck("$Email");

and i am using this if condition to give me a final answer::::: if (($acc==TRUE)AND($acc1==TRUE))


I will be very greatfull if someone helps me thank you
Link to comment
Share on other sites

This is what I did, hope you know where you went wrong.
[code]<?php

function validateEmail($email)
{
    $email_pattern = '^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$';
    if (eregi ($email_pattern, $email) )
    {
        $ans1 = TRUE;
    }
    else
    {
        $ans1 = FALSE;
    }
    return $ans1;
}

if (validateEmail("hackerkts@gmail.com") == TRUE) {
    echo "TRUE";
    } else {
        echo "FALSE";
        }
?>[/code]
Link to comment
Share on other sites

[!--quoteo(post=385892:date=Jun 20 2006, 10:08 AM:name=hackerkts)--][div class=\'quotetop\']QUOTE(hackerkts @ Jun 20 2006, 10:08 AM) [snapback]385892[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This is what I did, hope you know where you went wrong.
[code]<?php

function validateEmail($email)
{
    $email_pattern = '^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$';
    if (eregi ($email_pattern, $email) )
    {
        $ans1 = TRUE;
    }
    else
    {
        $ans1 = FALSE;
    }
    return $ans1;
}

if (validateEmail("hackerkts@gmail.com") == TRUE) {
    echo "TRUE";
    } else {
        echo "FALSE";
        }
?>[/code]
[/quote]


[!--quoteo(post=385887:date=Jun 20 2006, 08:16 AM:name=Terfanda)--][div class=\'quotetop\']QUOTE(Terfanda @ Jun 20 2006, 08:16 AM) [snapback]385887[/snapback][/div][div class=\'quotemain\'][!--quotec--]
function emailcheck($Email)
{
if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email))
{
$ans1=FALSE;
}
else
{
$ans1= TRUE;
}
return $ans1;

}

Hello agian I will be very thankfull if someone help I am using this function up it seems it is wrong can someone tells me where is my mistake

i am calling it here:::::: $acc=emailcheck("$Email");

and i am using this if condition to give me a final answer::::: if (($acc==TRUE)AND($acc1==TRUE))
I will be very greatfull if someone helps me thank you
[/quote]


Thank You
I understood it and i will try it
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.