...

View Full Version : php



harry343
04-27-2011, 11:09 AM
I have an function in error-status.php like this


function validateHostName($hostName)
{
if((strpbrk($hostName,'`~!@#$^&*()=+.[ ]{}\\|;:\'",<>/?')==FALSE) &&

!ctype_digit($hostName) && eregi("^([a-z0-9-]+)$",$hostName) &&

ereg("^[^-]",$hostName) && ereg("[^-]$",$hostName))
{
return true;
}
else
return false;
}

now i want to cal this function in my other page which is datetime.php how it is

posible plz plz help me its serious

if($addntp=="")
{
seterror("0:|: :|: Add NTP server");

//$error_text="NTP server already

added"."\n"."Exiting ...";
//AddLog("timeconfig.php",$error_text,ERR_INFO);

header("Location: datetime.php");
exit;
}

bullant
04-27-2011, 11:24 AM
Did you write that code or did you copy it from somewhere?

The reason I ask is because you are using eregi which is deprecated - you can use preg_match (http://au2.php.net/manual/en/function.preg-match.php) instead.

harry343
04-27-2011, 12:13 PM
bro i want reply so plz reply my ans

bullant
04-27-2011, 12:22 PM
from the php manual about ereg (http://php.net/manual/en/function.eregi.php)i


WarningThis function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

harry343
04-27-2011, 12:32 PM
kkk bro just forget all things in php i only want to cal this function



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum