PHP Classes
Icontem

Subject: DNS.PHP file giving error


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend!

      E-mail address validation class   All threads   DNS.PHP file giving error   (Un) Subscribe thread alerts  
Subject:DNS.PHP file giving error
Summary:Error message
Messages:10
Author:David Halliday
Date:2007-08-07 06:27:26
Update:2008-11-06 19:20:05
 

  1. DNS.PHP file giving error   Reply  
Picture of David Halliday
David Halliday
2007-08-07 06:27:26
Hi
The 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

  2. Re: DNS.PHP file giving error   Reply  
Picture of David Halliday
David Halliday
2007-08-09 18:07:32
Hello
Just 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

  3. Re: DNS.PHP file giving error   Reply  
Picture of Manuel Lemos
Manuel Lemos
2007-08-16 22:18:08
You 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";

  4. Re: DNS.PHP file giving error   Reply  
Picture of David Halliday
David Halliday
2007-08-17 12:17:01
Thank 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

  5. Re: DNS.PHP file giving error   Reply  
Picture of Manuel Lemos
Manuel Lemos
2007-08-17 20:34:48
I don't know. Maybe you can find help in the groups of alt.comp.networking:

http://groups.google.com/groups/dir?q=alt.comp.networking

  6. Re: DNS.PHP file giving error   Reply  
Picture of David Halliday
David Halliday
2007-08-17 22:00:29
Many thanks!

  7. Re: DNS.PHP file giving error   Reply  
Picture of safuk mankur
safuk mankur
2007-09-06 16:37:20
Did you have any succes.
If yes, can you share your modifications? I am having the same problem.
Thank you!

  8. Re: DNS.PHP file giving error   Reply  
Picture of David Halliday
David Halliday
2007-09-08 05:37:58
yes, 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!

  9. Re: DNS.PHP file giving error   Reply  
Picture of safuk mankur
safuk mankur
2007-09-08 11:04:33
I 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@your.isp and it should bypass the reverse dns lookup(I believe).

  10. Re: DNS.PHP file giving error   Reply  
Picture of ck miller
ck miller
2008-11-06 19:20:05
If 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;
}

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products