Jump to content

[SOLVED] Call to undefined function: Similar to mysql_connect, but completely different


trn579s

Recommended Posts

 

 

I just installed php4.4.3/mysql4.1.21/apache1.3.37 on my local machine and have run into a snag.  I am getting the following error when I try to call one of my own user defined functions (Fatal error: Call to undefined function: verifyEmail() in C:\xampp\htdocs\Guar...)  verifyEmail is a function that I wrote, and works just fine on my production server, but not on my local machine setup... which has all the same versions of php, mysql, and apache.  verifyEmail is in an include file that is being read correctly (I tested it with a <?php print "test"; ?> and got a result)  So, here is my function call:

 

$valid = verifyEmail($EmailAddress);

 

Here is my function in the includes file:

 

function verifyEmail ($testString) {

// Check for a valid email address

return (eregi("^([[:alnum:]]|_|\.|-)+@([[:alnum:]]|\.|-)+(\.)([a-z]{2,4})$", $testString));

}

 

 

Anyone have a clue as to what stupid mistake I am making? I have spent all day tinkering with php and apache settings and everything in between.

 

Thanks,

 

Tom

Link to comment
Share on other sites

Yep.  I can fire a print statement in the includes file before and after my function. 

 

NEW DEVELOPMENT - If I put the function on the same page as my code (instead of using an include file) it works just fine.  I have been over and over the syntax on the files, and everything is good there.

 

Any ideas on what would cause that error 'undefined function' when I try to call it from an includes file, but not when I call it from within the same page.  Note:  I do have register_global on.

 

Thanks,

 

Tom

Link to comment
Share on other sites

Is there some setting in Apache of PHP that prevents calling a user defined function, or requires it to be specified differently that I have specified it?

 

Here is my include and call to the function:

include $includesPath."validation_functions.php";

$valid = verifyEmail($EmailAddress);

 

And here is my function in the included file:

 

function verifyEmail ($testString) {
// Check for a valid email address 
return (eregi("^([[:alnum:]]|_|\.|-)+@([[:alnum:]]|\.|-)+(\.)([a-z]{2,4})$", $testString));
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.