<?php session_start();?>
<?php require_once('unibenkgh.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_customerdata = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_customerdata = $_SESSION['MM_Username'];
}
mysql_select_db($database_unibenkgh, $unibenkgh);
$query_customerdata = sprintf("SELECT * FROM ibank WHERE customernum = %s", GetSQLValueString($colname_customerdata, "text"));
$customerdata = mysql_query($query_customerdata, $unibenkgh) or die(mysql_error());
$row_customerdata = mysql_fetch_assoc($customerdata);
$totalRows_customerdata = mysql_num_rows($customerdata);
?>
<?php

/**
 * @author 
 * @copyright 2010
 */

##Verifying a form text field input against a session variable data
##If for data is equal to session data, the page will redirect to the transfering.php page
##else echo an error message.

$from = $row_customerdata['email'];

$sender = $row_customerdata['accholder'];

$to = "#";

$messages = $_POST['message'];

$subject = $_POST['subject'];

$headers = "From: $from; X-Mailer: $sender \n";


mail($to, $subject, $messages, $headers);

$_SESSION['SESS_RESULT'] = "Message Sent"; 

?>
<HTML>
<!-- Created by HTTrack Website Copier/3.43-9 [XR&CO'2010] -->

<!-- Mirrored from www.regencytb.com/en/ by HTTrack Website Copier/3.x [XR&CO'2010], Mon, 13 Sep 2010 03:12:26 GMT -->
<HEAD>
<TITLE>Message sent...</TITLE>
</HEAD>
<BODY>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=fdbcare.php">
<A HREF="fdbcare.php"><B>Message sent... redirecting.</B></A>
</BODY>
<!-- Created by HTTrack Website Copier/3.43-9 [XR&CO'2010] -->

<!-- Mirrored from www.regencytb.com/en/ by HTTrack Website Copier/3.x [XR&CO'2010], Mon, 13 Sep 2010 03:12:27 GMT -->
</HTML>
