zohab Posted November 4, 2009 Share Posted November 4, 2009 Hi, On my site user need to fill form and form contains email field. user will enter email as xyz@example.com,pqr@zapak.com ,abc@gmail.com etc I need to check example.com ,zapak.com,xyz.com,gmail.com exists or not. Quote Link to comment https://forums.phpfreaks.com/topic/180228-domain-validation-php-script/ Share on other sites More sharing options...
Lukeidiot Posted November 9, 2009 Share Posted November 9, 2009 Here you go, if you modify it to read the right regex this script will work. Example useage: val.php?e=google.com (will return valid, currently doesnt work for test@google.com, you need regex to read it right); <?php error_reporting(0); function Status($site, $port){ $fp = fsockopen($site,$port,$errno,$errstr,1); if(!$fp){ echo "<font color='red'><strong>Invalid</strong></font>"; } else { echo "<font color='green'><strong>Valid!</strong></font>"; fclose($fp); } } Status("$_GET[e]","80"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/180228-domain-validation-php-script/#findComment-954172 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.