I want to call function in PHP i use require_once for this .... now i want to call the function in a particular event how it is done ?
For example I have an function
function validateHostName($hostName) {
if ((strpbrk($hostName, '`~!@#$^&*()=+.[ ]{}\\|;:\'",<>/?') == FALSE) && !ctype_digit($hostName) && eregi("^([a-z0-9-]+)$", $hostName) && ereg("^[^-]", $hostName) && ereg("[^-]$", $hostName)) {
return true;
}
else return false;
}
in error-status.php file .. (external file) now i want to cal this file in 2.php in between here
else if ($apply == "Add") {
//$length=$doc->getElementsByTagName('Server')->length;
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;
}
can u help me fast ... how it is call ... i use require function for include ....