Display(); exit; } else { if (strtoupper($SecretCode) != $sSecretCode) { $Error = "ʼԴ"; $tp = new Template($tp_index); $tp->Display(); exit; } $InterestShow = ""; if (is_array($Interest)) { foreach ($Interest as $InterestData) { $InterestShow .= "$InterestData, "; } } $objDb = mysql_connect($strCfgDbHost,$strCfgDbUser,$strCfgDbPass); mysql_select_db($strCfgDbName); if (!$objDb) { die('Could not connect: ' . mysql_error()); } #mysql_query("SET NAMES TIS620"); #mysql_query("SET character_set_results=tis620"); $strSql = " INSERT INTO $strCfgDbTableContact (Subject,Name,Email,Phone,Operator,Mobile,BusinessType,Country,Message,IsMember,Interest,IsReply,AddDate) VALUES ('$Subject','$Name','$Email','$Phone','$Operator','$Mobile','$BusinessType','$Country','$Message','$IsMember','$InterestShow','N',NOW()) "; mysql_query($strSql); $ContactId = mysql_insert_id(); $strFileField = "File1"; $strFileNewName = "$ContactId-1"; $strUploadToPath = "$strCfgUploadPathContact"; $strOnlyFileType = "image|text|pdf|word|excel"; # File type header. Use | for more type eg. txt|pdf|doc $intMaxFileSize = 204800; # 200K if ($_FILES["$strFileField"]["name"]) { $strUploadFileArr = UploadFile($strFileField,$strFileNewName,$strUploadToPath,$strOnlyFileType,$intMaxFileSize); if (is_array($strUploadFileArr)) { $strSql = " UPDATE $strCfgDbTableContact SET File1Name = '$strUploadFileArr[name]' WHERE ContactId = $ContactId "; mysql_query($strSql); $AttachUrl = "$strCfgMainUrl/files/contact/$strUploadFileArr[name]"; } } mysql_close($objDb); $tp_mail = new Template($tp_index_mail); $MessageShow = nl2br($Message); $Body = $tp_mail->generate(); #send_email("TumCivil","tumcivil@yahoo.com",$Name,$Email,$Subject,$Body,true,$attachs); send_email("TumCivil","tumcivil@gmail.com",$Name,$Email,$Subject,$Body,true,$attachs); $tp = new Template($tp_index_complete); $tp->Display(); exit; } /*------------------------------------------------------------------*/ ?>