require_once("config.php"); ?>
error_reporting(E_ALL ^ E_NOTICE);
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
function connectDB($host="", $usr="", $pwd="", $db="")
{
global $GDATABASE_HOST, $GDATABASE_USER_ID, $GDATABASE_USER_PWD, $GDATABASE_NAME;
// initialization
$host?$host:$host=$GDATABASE_HOST;
$usr?$usr:$usr=$GDATABASE_USER_ID;
$pwd?$pwd:$pwd=$GDATABASE_USER_PWD;
$db?$db:$db=$GDATABASE_NAME;
$mysqli = new mysqli($host, $usr, $pwd, $db);
$mysqli->query("SET NAMES 'utf8'");
if ($mysqli->connect_error)
{
die('Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error);
}
else
{
return $mysqli;
}
return NULL;
}
function db_result_to_array($result) {
$res_array = array();
if (!empty($result)) {
for ($count=0; $row = $result->fetch_assoc(); $count++) {
$res_array[$count] = $row;
}
return $res_array;
}
}
function dateDefine($val) {
$str= "";
switch ($val) {
case "01":
$str= "st";
break;
case "02":
$str= "nd";
break;
case "03":
$str= "rd";
break;
default:
$str= "th";
}
return $str;
}
function emailto($From_name, $From, $To, $subject, $message)
{
ini_set('sendmail_from', $From);
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
} else {
$eol="\n";
}
// Common Headers
$headers .= 'From: '. encodeMIMEString ("UTF-8", $From_name).' <'.$From.'>'.$eol;
$headers .= 'Reply-To: '.$To.$eol;
$headers .= 'Return-Path: '.$From.$eol; // these two to set reply address
$headers .= "Message-ID:<".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$send_message = "";
//Attachment
$send_message = "This is a multi-part message in MIME format.\n\n" .
"Content-Type: text/html; charset=\"utf-8\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
$bool = mail($To, encodeMIMEString ("UTF-8", $subject), $send_message, $headers, "-f".$From);
return $bool;
}
function encodeMIMEString ($enc, $string)
{
return "=?$enc?B?".base64_encode($string)."?=";
}
?>
Fatal error: Call to undefined function connectDB() in C:\xampp\htdocs\en\gold\demo-acc-reg-form.php on line 4