| Current Path : /var/www/cesa.co.za/members/inc/ |
| Current File : /var/www/cesa.co.za/members/inc/func.inc |
<?php
// System Wide Functions
// This file should contain all re-useable Functions
// Page or Task specific functions should be included only on pages needed.
// PLEASE NOTE, no authentication functions should be included here.
include_once($_SERVER['DOCUMENT_ROOT'] . "/cfg/config.php");
include_once($_SERVER['DOCUMENT_ROOT'] . "/cesanet/inc_shared.php");
function systemerror($errortype, $problem, $pageoccurred, $resolution) {
$title = "members.saace.co.za - $errortype error";
?>
<html><head><title><?php echo $errortype ?></title>
<link rel="stylesheet" href="/inc/default.css" type="text/css">
</head>
<body>
<!-- Start Page Content Here -->
<table width="700" cellpadding="10" border="0" cellspacing="0"><tr><td valign="top">
<div class="outline">
<h3><?php echo $errortype ?></h3>
<p>
An error has occured</b>:
</p>
<p>
"<?php echo $problem ?>"
</p>
<p>
<?php echo $resolution ?>
</p>
<p>
If you are still having trouble and you are sure this is a valid problem please email <a href="mailto:memberservices@saace.co.za">memberservices@saace.co.za</a> with a full description of what you were trying to do and be sure to copy the information on this page.
</p>
</div>
</td></tr></table>
<!-- End Page Content Here -->
</body>
</html>
<?php
die();
}
function zadate() {
$zadate = gmdate("d F Y", time() + 7200);
return $zadate;
}
/* * ******************************************************
* To check if a certain field has been filled out. *
* usage: checkIt(variable, question number) *
* ****************************************************** */
function checkIt($what, $question) {
if ($what == '' || strlen($what) < 1) {
return false;
} else {
return true;
} //end if else
}
//end function
/* * *********************************************
* Function to see if a email address can exist *
* usage: $bool = checkEmail($email_address) *
* ********************************************* */
function checkEmail($email) {
if (eregi("(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)", $email) || !eregi("^.+\@(\[?)[-a-zA-Z0-9\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$", $email)) {
return false;
} else {
list($user, $domain) = explode(`@`, $email);
if ((!eregi("^[a-zA-Z0-9\.\-]+$", $user)) || (!eregi("^[a-zA-Z0-9\.\-]+$", $domain))) {
return false;
} else {
return true;
} //end if else
} //end if else
}
//end function
/* * **************************************
* Function checks to see if there *
* are any numbers in a string. *
* If there are, return true, else *
* return false. *
* Usage: if(checkForNumbers(string)) *
* ************************************** */
function checkForNumbers($string) {
if (ereg("[0-9]", $string) == 0) {
return false;
} else {
return true;
} //end if else
}
//end function