 <?php
if (isset($_POST['submit'])) {
	$name=$_POST['name'];
	$email=$_POST['email'];
    $phone=$_POST['contact'];
	$location=$_POST['location'];
	$company=$_POST['company'];
	$message=$_POST['message'];
	$product=$_POST['productname'];
	$word = "http"; 
 

	$headers='From:'.$email."\n".'Reply-To:'.$email."\n".	
    'X-Mailer: PHP/' . phpversion()."\n".'content-type :text/html;charset=UTF-8';
	$message='<br>Name: '.$name.'<br>Email: '.$email.'<br>Phone: '.$phone.'<br>Location: '.$location.'<br>Company: '.$company.'<br>Product: '.$product.'<br>Message: '.$message. '<br>';
	if(mail('sales@euctechnowood.com','enquiry mail from brochure',$message,$headers)){
	    
	
	    
	        
	  if ($product === "Alphacam") {
    // Redirect to the index page
    header('Location: assets/img/brochure/alphacam.pdf');
    // exit; // Make sure to exit after the redirect
     } 
     if ($product === "Cabinet vision"){
    header('Location: assets/img/brochure/cabinet_vision.pdf');
     }
     if ($product === "Peps"){
    header('Location: assets/img/brochure/peps.pdf');
     }
     if ($product === "Visi"){
    header('Location: assets/img/brochure/visi.pdf');
     }
     if ($product === "Worknc"){
    header('Location: assets/img/brochure/worknc.pdf');
     }

	    
	    
	    
	    
	    
	    
	    
	    
	    
	    
// 	    echo "123";
// 		header('Location:assets/img/brochure/alphacam.pdf?Massage=sent');
	}
else{
    //   echo "123456";
	header('Location:brochure.html?Message=error');
}
	
}

?>
