

<?php 
session_start();

?>
<?php
$to = "enquiry@chue.com.my";
$to1 = "admin@chue.com.my";
$subject = 'Contact From chue.com.my';
$firstname = $_REQUEST['form_firstname'] ;
$companyname = $_REQUEST['form_companyname'] ;
$phonenumber = $_REQUEST['form_phonenumber'] ;
$url = $_REQUEST['form_url'] ;
$email = $_REQUEST['form_email'] ;
$message = $_REQUEST['form_message'] ;
$headers = "From:$email";
$website = "$url";
$content = "Name: $firstname\nCompany Name: $companyname\nPhone Number: $phonenumber\nMessage: $message";


if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {

$sent = mail($to, $subject, $content, $headers) ;


}
if($sent){

/* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
?>
<script type="text/javascript">
<!--
window.location = "http://www.chue.com.my/contact-us/contact-success"
//-->
</script>
<?php


}
else{
/* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
?>
<script type="text/javascript">
<!--
window.location = "http://www.chue.com.my/contact-us/contact-fail"
//-->
</script>
<?php
}
?>


