ghgarcia Posted December 19, 2006 Share Posted December 19, 2006 I use fsockopen to test a user email address before updating my database. However if the address is not valid I get a warning message what I want is not to display the error message since I'm already looking for the address to be valid or not. The following is the code that I use.[quote]if(checkEmail([email protected]) == FALSE) { echo "E-mail entered is not valid.";} else { echo "E-mail entered is valid.";}function checkEmail($email) { if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email)) { return FALSE; } list($Username, $Domain) = split("@",$email); if(getmxrr($Domain, $MXHost)) { return TRUE; } else { if(fsockopen($Domain, 25, $errno, $errstr, 30)) { return TRUE; } else { return FALSE; } }}[/quote]I want to display only my text not the warning.Any help would be greatly appreciated.Thanks Link to comment https://forums.phpfreaks.com/topic/31182-fsockopen-warning-message/ Share on other sites More sharing options...
michaellunsford Posted December 19, 2006 Share Posted December 19, 2006 the magic at symbol -- which is PHP for "hush"if(@fsockopen($Domain, 25, $errno, $errstr, 30)) Link to comment https://forums.phpfreaks.com/topic/31182-fsockopen-warning-message/#findComment-144204 Share on other sites More sharing options...
ghgarcia Posted December 19, 2006 Author Share Posted December 19, 2006 That did it. Really appreciate the helpG ;D Link to comment https://forums.phpfreaks.com/topic/31182-fsockopen-warning-message/#findComment-144208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.