Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call to undefined function

Status
Not open for further replies.

parallon

MIS
Dec 27, 2002
103
0
0
US
Hey there all. Working on a comment input form, and when I click on submit, I get the following error:


Fatal error: Call to undefined function checkdnsrr() in c:\wamp\ on line 299


I am running PHP5. Testing is done on local PC. Any idea what the problem could be?

Thanks in advance,

Parallon

"I used to think that the more that you knew, the farther you would go, then I realized that the more that you know, the more they use you."

-Me
 
I am running on XP Pro, so I realize now that I have a problem there. I saw that there were a few work arounds, but not sure how to implement them.

Just out of curiosity, judging by what I have now read, if I left everything the way it is, and posted this site to a UNIX server, all would work fine?

"I used to think that the more that you knew, the farther you would go, then I realized that the more that you know, the more they use you."

-Me
 
Don't mean to be a bother, but here is what the code has:


$Host = explode("@",$_POST[$Field]);
if (!checkdnsrr($Host[1].'.', 'MX'))
{
$Field = str_replace("_"," ",$Field);
$Field = ucfirst($Field);
$IncorrectFields .= "<li><b>$Field</b>&nbsp;requires an existing domain name in the email format.</li>";
if ($Preview == "1")
$Redfields .= "$Field,";



How would I implement one of the workarounds that are at:


Or is it more difficult than it looks?

Thanks,

Parallon

&quot;I used to think that the more that you knew, the farther you would go, then I realized that the more that you know, the more they use you.&quot;

-Me
 
No, not hard at all. use function_exists to check if the function exists and if it doesn't (it doesn't in your case) define it yourself as in:

Code:
if (!function_exists('checkdnsrr') {
   function checkdnsrr($host, $type='') {
    // Use one of the implementations on the php.net
    // checkdnsrr page you mentioned
   }
}

Alternately you can use the PEAR Net_DNS library instead as the PHP manual suggests, which might be a better solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top