function GetFileExtension($file){
$revfile=strrev($file); // Reverse the string for getting the extension
$arr_t=explode(".",$revfile);
$file_type=$arr_t[0];
return strrev($file_type); // File Extension
}
if($_POST['_fname']&& $_POST['_email'])
{
$allowed_extensions = array("dwg", "jpeg","jpg", "doc", "docx", "png");
$message='Requirement Form.:
';
if($_POST['_fname'])
{
$message.='Name: :'.$_POST['_fname'].'
';
}
if($_POST['_email'])
{
$message.='Email Id: :'.$_POST['_email'].'
';
}
if($_POST['_mobile'])
{
$message.='Mobile: :'.$_POST['_mobile'].'
';
}
if($_POST['_subject'])
{
$message.='Subject: :'.$_POST['_subject'].'
';
}
if($_POST['_massege'])
{
$message.='Message: :'.$_POST['_massege'].'
';
}
$to = 'sales@rangerfiresystems.com.sg';
$sSubject = "Customer Query For Ranger Fire Systems";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:'.$_POST['_email']. "\r\n";
if($_FILES['attachment']['name'])
{
echo 'ext : '.$ext = GetFileExtension($_FILES['attachment']['name']);
if(in_array($ext,$allowed_extensions))
{
$UploadDoc = 'upload/'.$_FILES['attachment']['name'];
if(move_uploaded_file($_FILES['attachment']['tmp_name'],$UploadDoc))
{
$message .= 'Click here to download file
';
}
$message.='Do not respond to this automatically generated email.
';
//echo $message;
@mail($to,$sSubject,stripcslashes($message),$headers);
@mail('rangerfiresystems@gmail.com',$sSubject,stripcslashes($message),$headers);
echo "";
}else{
$msg = 'Please upload correct file. We accept only dwg,jpeg,doc and png files';
}
}else{
$message.='Do not respond to this automatically generated email.
';
@mail($to,$sSubject,stripcslashes($message),$headers);
@mail('rangerfiresystems@gmail.com',$sSubject,stripcslashes($message),$headers);
echo "";
}
//header("location: thankyou.php");
}
?>
include_once('header.php');?>
Contact Us
 |
Sales: 9226 4622
Office: 6255 7039 |
 |
sales@rangerfiresystems.com.sg |
 |
Blk 1002, Toa Payoh Industrial Park
#03-1439
Singapore 319074 |
 |
Fax: 6255 7051 |
|
|
include_once('footer.php');?>