session_start(); require('config.php'); require_once('include/functions.php'); require_once('include/user_functions.php'); require_once('include/islogged.php'); // define meta tags & common variables $meta_title = 'Contact '._SITENAME.' team'; $meta_description = ''; // end $post_email = trim(secure_sql($_POST['your_email'])); $post_name = trim(secure_sql($_POST['your_name'])); $importance = trim(secure_sql($_POST['importance'])); $topic = trim(secure_sql($_POST['select'])); $msg = trim(secure_sql($_POST['msg'])); $ip = secure_sql($_SERVER['REMOTE_ADDR']); if( isset($_POST['Submit']) && $_POST['Submit'] == "Send message" ) { // check capcha code include ("include/securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['image_text']); if (!is_real_email_address($post_email)) { $err_email = "Email address is not valid."; $smarty->assign('err_email', $err_email); } if( !$valid ) { $err_captcha = "The code you have entered is incorrect"; } elseif ($valid && is_real_email_address($post_email)) { $confirm_send = '1'; $smarty->assign('confirm_send', $confirm_send); // ** SENDING EMAIL ** // require_once("include/class.phpmailer.php"); //*** DEFINING E-MAIL VARS $mailsubject = $post_name.' sent you a message from '._SITENAME; $array_content[]=array("post_email", $post_email); $array_content[]=array("post_name", $post_name); $array_content[]=array("importance", $importance); $array_content[]=array("topic", $topic); $array_content[]=array("msg", $msg); $array_content[]=array("ip", $ip); //*** END DEFINING E-MAIL VARS @send_a_mail($array_content, _EMAIL, $mailsubject, 'email_template/email_for_webmaster.html'); // ** END SENDING EMAIL ** // } } // ASSIG ERRORS $smarty->assign('err_captcha', $err_captcha); // END ERRORS // --- DEFAULT SYSTEM FILES - DO NOT REMOVE --- // $smarty->assign('meta_title', $meta_title); $smarty->assign('meta_description', $meta_description); $smarty->assign('template_dir', $template_f); $smarty->display('contact_us.tpl'); ?>