|  | 
  David Halliday - 2007-08-07 06:27:26HiThe class works fine on linix but I need it on my box using windows.
 
 I have downloaded The DNSResolver class and placed the DNS.php and rrcompat.php in the same folder as the email_validation.php and getmxrr.php files.
 
 When I use the test file:  "test_email_validation.php" an error appears that states:
 
 "Warning: fread(): Length parameter must be greater than 0  in DNS.php on line 224"
 
 Is there something missing? Should one use the other 3 files that come with the DNSResolver class, namely:
 fetchdns.c
 makebcc.bat
 makegcc.bat
 
 Any help would be greatly appreciated,
 Thanks
 
  David Halliday - 2007-08-09 18:07:32 - In reply to message 1 from David HallidayHelloJust thought of putting the question in a different way!
 
 I need to get the "E-mail address validation" class to work on windows xp. Has anyone tried it on windows?  If the problem explianed previously is a common one or tere is no real solution to it, could someone please suggest an alternative to php.dns?
 
 Have tried pear NET_DNS module. That is not working either!
 
 Any help would be greatly appreciated,
 thanks
  Manuel Lemos - 2007-08-16 22:18:08 - In reply to message 2 from David HallidayYou just need to provide a function that implements the same functionality of PHP GetMXRR() function and assign the e-mail validation getmxrr class variable with the name of your replacement function.
 $validator->getmxrr = "MyGetMXRR";
  David Halliday - 2007-08-17 12:17:01 - In reply to message 3 from Manuel LemosThank you very much for your reply. 
 I've been working on a function that implements "nslookup" instead of ipconfig.  Still struggling with it but I think it will work.
 
 OFF-TOPIC REQUEST:  Can you recommend an active forum or yahoo group that discusses networking-related issues like the ones involved in this class (or in general)?
 
 Would be grateful if you did!
 Best regards
  Manuel Lemos - 2007-08-17 20:34:48 - In reply to message 4 from David Halliday
  David Halliday - 2007-08-17 22:00:29 - In reply to message 5 from Manuel LemosMany thanks!
  safuk mankur - 2007-09-06 16:37:20 - In reply to message 2 from David HallidayDid you have any succes.If yes, can you share your modifications? I am having the same problem.
 Thank you!
  David Halliday - 2007-09-08 05:37:58 - In reply to message 7 from safuk mankuryes, using "nslookup" works with 100% accuracy when yahoo + gmail addresses are validated.
 Let me try to tidy up the script a little bit and then I'll post something!
 
 NOTE: I cannot validate hotmail or msn addresses from Windows because they require my machine ip address to pass "reverse dns lookup". This particular service provider, like many others, has not added an mx record for the range of ip addresses it allocates to subscribers!  Still trying to find a way round it!
  safuk mankur - 2007-09-08 11:04:33 - In reply to message 8 from David HallidayI can hardly wait to make it work. I am not a php guru and your help is much appreciated. 
As with MSN and hotmail accounts, perhaps it would be better to use for testing an [email protected]  and it should bypass the reverse dns lookup(I believe). 
  ck miller - 2008-11-06 19:20:05 - In reply to message 1 from David HallidayIf you are on Windows try replacing getmxrr.php with this. This code does not need dns.php:
 <?php
 
 function GetMXRR( $hostname, &$mxhosts, &$weight ) {
 if (!is_array ($mxhosts) ) {
 $mxhosts = array ();
 }
 
 if (!empty ($hostname) ) {
 $output = "";
 @exec ('%SYSTEMDIRECTORY%\\nslookup.exe -q=mx '.escapeshellarg($hostname), $output);
 $imx=-1;
 foreach ($output as $line) {
 $imx++;
 $parts = "";
 if (preg_match ("/^$hostname\tMX preference = ([0-9]+), mail exchanger = (.*)$/", $line, $parts) ) {
 $weight[$imx] = $parts[1];
 $mxhosts[$imx] = $parts[2];
 }
 }
 return ($imx!=-1);
 }
 return false;
 }
 
 ?>
 |