chizijs Posted May 3, 2010 Report Share Posted May 3, 2010 (edited) Kods: http://paste.php.lv/bb13b5f28746b458da6f9975d8391e56?lang=php Problēma ir tāda, kad ievāda nekorektu epastu, piemēram shis_nav_epasts parāda, ka epasts ir nepareizs, bet kad ievāda pareizu epastu, chizijs@epasts.com tad echo 2; [ka epasts ir nepareizs] un nekādus datus neliek failā. Uz PC viss labi iet, bet kad uzliku uz 000webhost.com hostinga, parādījas šī problēma Edited May 3, 2010 by chizijs Quote Link to comment Share on other sites More sharing options...
emsy Posted May 3, 2010 Report Share Posted May 3, 2010 (edited) Kāpēc tev tā validemail() funkcija ir tik gara??? Lieto šito, jo viņa arī pārbauda MX serveri, tbš jefiņi nevarēs ievadīt e-pastu, piem. kaka@kaka.asd: function valid_email($email) { if( (preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $email)) || (preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',$email)) ) { $host = explode('@', $email); if(checkdnsrr($host[1].'.', 'MX') ) return true; if(checkdnsrr($host[1].'.', 'A') ) return true; if(checkdnsrr($host[1].'.', 'CNAME') ) return true; } return false; } if (!function_exists('checkdnsrr')) { function checkdnsrr($host, $type = '') { if(!empty($host)) { if($type == '') $type = "MX"; @exec("nslookup -type=$type $host", $output); while(list($k, $line) = each($output)) { if(eregi("^$host", $line)) { return true; } } return false; } } } Edited May 3, 2010 by emsy Quote Link to comment 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.