GIrish BM Posted January 28, 2010 Share Posted January 28, 2010 Hi, I want to implement the following in my web page in sign up we will ask to enter user existing email id , so now i need to check weather the entered email currently available are not without sending any confirmation mail can any body help me to write php script r code , atleast few examples on this one Thanks In advance regard's girish [email protected] Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/ Share on other sites More sharing options...
ChemicalBliss Posted January 28, 2010 Share Posted January 28, 2010 With sending a verifiable email to that specific email address, there is no way of knowing if it truly exists unless you have access to the Database that contains the names configured for that domain. The Domain however you can check quite thoroughly. You can use a WHOIS (id reccomend using a specialized Class). or you can just ckeck if it exists by asking for an ip address (one simple function does this in PHP). -CB- Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003018 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 hi, ya as u said we need to write the php script to deal with whois server. can u help me to write script in this............... Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003462 Share on other sites More sharing options...
trq Posted January 29, 2010 Share Posted January 29, 2010 ya as u said we need to write the php script to deal with whois server. Simply checking the domain exists is no guarantee the email address exists. What your asking isn't possible. Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003477 Share on other sites More sharing options...
oni-kun Posted January 29, 2010 Share Posted January 29, 2010 ya as u said we need to write the php script to deal with whois server. Simply checking the domain exists is no guarantee the email address exists. What your asking isn't possible. You can check to see if the domain in the e-mail has an MX record (not that the physical address exists, but that is a valid acceptable address) list($Email, $domain) = split("@", $Email, 2); if (! checkdnsrr($domain, "MX")) { die('E-mail does not exist') }else { $array = array($Email, $domain); $Email = implode("@", $array); } Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003478 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 hi, I want to implement the following in my web page in sign up we will ask to enter user existing email id , so now i need to check weather the entered email currently available are not without sending any confirmation mail here is my complete code for your php script can any body tell me what is wrong in this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form method="post"> <div> <input type="text" name="email" /> <input type="submit" name="checkMail" value="Search Mail"/> <?php if(isset($_POST['checkMail'])){ $Email = $_POST['email'] list($Email, $domain) = split("@", $Email, 2); if (! checkdnsrr($domain, "MX")) { die('E-mail does not exist') }else { $array = array($Email, $domain); $Email = implode("@", $array); } } ?> </div> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003501 Share on other sites More sharing options...
trq Posted January 29, 2010 Share Posted January 29, 2010 can any body tell me what is wrong in this Not without a description of what you expect it to do and what it actually does. Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003503 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 i am not getting any o/p , i am getting error message as error in list like that................ Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003505 Share on other sites More sharing options...
trq Posted January 29, 2010 Share Posted January 29, 2010 i am getting error message as error in list like that................ Pardon? Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003507 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 hi thrope <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form method="post"> <div> <input type="text" name="email" /> <input type="submit" name="checkMail" value="Search Mail"/> <?php if(isset($_POST['checkMail'])){ $Email = $_POST['email']; list($Email, $domain) = split("@", $Email); if (! checkdnsrr($domain, "MX")) { die('E-mail does not exist'); }else { $array = array($Email, $domain); $Email = implode("@", $array); } } ?> </div> </form> </body> </html> The above is my script. i think u know that i need to achieve this "as soon as user enter his email id i need to check weather it is used r not" can u please suggest me some code.. i am getting o/p as blank page the url :- http://pbminfotech.com/girish/test/ Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003511 Share on other sites More sharing options...
trq Posted January 29, 2010 Share Posted January 29, 2010 That form seems to work fine to me. Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003514 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 ho is it did u edit the code if so plz send me the code. i need to display a message as "Email ID is correct" if the email exist r viceversa plz Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003525 Share on other sites More sharing options...
ChemicalBliss Posted January 29, 2010 Share Posted January 29, 2010 It's great youve got this far bud but if you want real-time reaction or conditioning then you need to use AJAX/Java, i'd suggest reading one of the millions of tutorials out there on google. Here, this will help you quicker and easier than here. http://lmgtfy.com/?q=PHP+User+Registration+Tutorial (Note: These forums are for helping fix your code, unfortunately you need to understand the basic structure of how php works and what you can do with it. For that, you need a dedicated tutorial for your level.) -CB- Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003630 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 Hi ChemicalBliss i don't want to check the login details but i need to check on domain for ex:- [email protected] , if user enters this it should check in google like that Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003642 Share on other sites More sharing options...
oni-kun Posted January 29, 2010 Share Posted January 29, 2010 Hi ChemicalBliss i don't want to check the login details but i need to check on domain for ex:- [email protected] , if user enters this it should check in google like that There isn't a method of really doing this. Gmail uses MX records in a way that makes it impossible to view if the client e-mail exists or not. Only [email protected] will normally work. There's no reliable way to check if the e-mail exists, That is why confirmation e-mails are sent by almost every software that exists. Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003646 Share on other sites More sharing options...
jl5501 Posted January 29, 2010 Share Posted January 29, 2010 There are 2 reasons why a confirm email is sent. 1 is as has been said, due to the near impossibility of determining programmatically if an address exists at a domain. 2 is because not only do we want to check that the address exists, but that the person registering has access to it Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003650 Share on other sites More sharing options...
GIrish BM Posted January 29, 2010 Author Share Posted January 29, 2010 ok i understand Quote Link to comment https://forums.phpfreaks.com/topic/190106-php-code-script-to-check-weather-the-given-email-exists-in-a-domain/#findComment-1003657 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.