Forum Moderators: coopster

Message Too Old, No Replies

Call to undefined function: filter var()

         

don_dr

3:10 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



i just experienced something rather strange. A friend asked me to help with some PHP programming on his site, and i am trying to use the filter_var() function to check mail validity, but i keep getting;

Fatal error: Call to undefined function: filter_var() in .......

This is quite strange to me cos it is the same check i use on my sites. I though it might have something to do with the server configurations, so i did a quick check, and the only noticeable difference so far is that my friends server is running PHP 5.2.5, whilst my PHP version is 5.2.6.

I dont want to believe this is the problem. Is it?

don_dr

3:21 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



Yeah,just to add this. i also noticed that register_globals are turned off.

Thanks.

jatar_k

3:30 pm on Aug 27, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



it seems to have been added from PECL to core in php 5.2.0 so it isn't the version but

[php.net...]

shows it still needing to be installed, here's the main page
[php.net...]

it's an extension so there must be settings in php.ini or it just needs to be installed. The docs are actually pretty thin on it.

don_dr

3:39 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



Okay, so i have to install it. but can this be done from within the script?

don_dr

3:44 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



maybe i could change it in .htaccess?

don_dr

4:48 pm on Aug 27, 2008 (gmt 0)

10+ Year Member



i guess there is nothing wrong with going the old fashioned way....

if( eregi("([_\.0-9a-z-]+@)([0-9a-z][0-9a-z-]+\.)+([a-z]{2,3})",$field) )
{
return TRUE;
}
else
{
return FALSE;
}
}

jatar_k

12:58 pm on Aug 28, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that's probably the best as you would need some type of server access to install