Jump to content


Photo

Email checking


  • Please log in to reply
3 replies to this topic

#1 ansarka

ansarka
  • Members
  • PipPipPip
  • Advanced Member
  • 128 posts
  • LocationCochin, Kerala, India

Posted 03 May 2006 - 11:06 AM

[!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--] Is ther any code in php to check wheather the enter email id exist or not. Plz reply if you hv answer[!--sizec--][/span][!--/sizec--]
EVEN THE WORD IMPOSSIBLE IS SAYING I' M' POSSIBLE

#2 umasankar

umasankar
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 03 May 2006 - 12:12 PM

[!--quoteo(post=370830:date=May 3 2006, 06:06 AM:name=anuka)--][div class=\'quotetop\']QUOTE(anuka @ May 3 2006, 06:06 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
[!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--] Is ther any code in php to check wheather the enter email id exist or not. Plz reply if you hv answer[!--sizec--][/span][!--/sizec--]
[/quote]


Hi anuka,

<?php
//Check whether the submission is made
if(!isset($_POST["hidSubmit"])){ $stremail="";
DisplayForm();
}
else{

//Validate the Email Address
$stremail=$_POST["txtemail"];
$result=ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$",$stremail,$trashed);
if(!$result){
echo "Enter a valid E-mail Address";
DisplayForm();
}
else{
echo "E-mail Address is Ok";
$stremail="";
DisplayForm();
}
}

//User-defined Function to display the form in case of Error
function DisplayForm(){
global $stremail;
?>


<form name="form1" method="post" action="">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033FF" bgcolor="#DEE3EF" >
<tr><td width="100%"><table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DEE3EF">
<caption align="top" class="heading">
E-Mail Validation
<br>
<tr>
<td width="46%"><br>
<div align="right">Enter An Email Address </td><td width="54%"><br>
<input name="txtemail" type="text" class="textbox" id="txtemail" value="<?php echo $stremail; ?>">
</tr>
<tr>
<td colspan="2"> <div align="center"><br>
<input name="Submit" type="submit" class="button" value="Submit">
<input name="hidSubmit" type="hidden" value="true">
</div>
</td>
</tr>
</td>
<?php
return;
}
?>

Take this Coding., its working...

Umasankar Subramanian

#3 ansarka

ansarka
  • Members
  • PipPipPip
  • Advanced Member
  • 128 posts
  • LocationCochin, Kerala, India

Posted 03 May 2006 - 12:16 PM

Umasankar Subramanian thank you for your reply

what i am looking for is if i enterd ansar@ansar.com

wheather ansar@ansar.com is a existing email id

EVEN THE WORD IMPOSSIBLE IS SAYING I' M' POSSIBLE

#4 umasankar

umasankar
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 03 May 2006 - 12:24 PM

[!--quoteo(post=370845:date=May 3 2006, 07:12 AM:name=Umasankar Subramanian)--][div class=\'quotetop\']QUOTE(Umasankar Subramanian @ May 3 2006, 07:12 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi anuka,

<?php
//Check whether the submission is made
if(!isset($_POST["hidSubmit"])){ $stremail="";
DisplayForm();
}
else{

//Validate the Email Address
$stremail=$_POST["txtemail"];
$result=ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$",$stremail,$trashed);
if(!$result){
echo "Enter a valid E-mail Address";
DisplayForm();
}
else{
echo "E-mail Address is Ok";
$stremail="";
DisplayForm();
}
}

//User-defined Function to display the form in case of Error
function DisplayForm(){
global $stremail;
?>
<form name="form1" method="post" action="">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033FF" bgcolor="#DEE3EF" >
<tr><td width="100%"><table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DEE3EF">
<caption align="top" class="heading">
E-Mail Validation
<br>
<tr>
<td width="46%"><br>
<div align="right">Enter An Email Address </td><td width="54%"><br>
<input name="txtemail" type="text" class="textbox" id="txtemail" value="<?php echo $stremail; ?>">
</tr>
<tr>
<td colspan="2"> <div align="center"><br>
<input name="Submit" type="submit" class="button" value="Submit">
<input name="hidSubmit" type="hidden" value="true">
</div>
</td>
</tr>
</td>
<?php
return;
}
?>

Take this Coding., its working...

Umasankar Subramanian
[/quote]


[!--quoteo(post=370849:date=May 3 2006, 07:16 AM:name=anuka)--][div class=\'quotetop\']QUOTE(anuka @ May 3 2006, 07:16 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Umasankar Subramanian thank you for your reply

what i am looking for is if i enterd ansar@ansar.com

wheather ansar@ansar.com is a existing email id
[/quote]

Ok. anuka,

But, if u want to do this u have to work with the database isn't it..

what i am trying to say is if we want to do comparison then we must require two fields...

so first u store that ansar@ansar.com in to the databaseb table..then compare this with the user input(using database connections)... ok ya?

Umasankar Subramanian.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users