0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
metalsh
/
pages
/
[
Home
]
File: send_quote_email.php
<link href="../css/style.css" rel="stylesheet" type="text/css" /> <?php function post_captcha($user_response) { $fields_string = ''; $fields = array( 'secret' => '6LcOLjEUAAAAANUPWDSa7ZlGUloHpFZ-Qdael2y5', 'response' => $user_response ); foreach($fields as $key=>$value) $fields_string .= $key . '=' . $value . '&'; $fields_string = rtrim($fields_string, '&'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify'); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, True); $result = curl_exec($ch); curl_close($ch); return json_decode($result, true); } // Call the function post_captcha $res = post_captcha($_POST['g-recaptcha-response']); if (!$res['success']) { // What happens when the CAPTCHA wasn't checked echo '<p>Please go back and make sure you check the security CAPTCHA box.</p><br>'; } else { // If CAPTCHA is successly completed... // Paste mail function here! //image uploading if((!empty($_FILES["uploaded_file1"])) && ($_FILES['uploaded_file1']['error'] == 0)) { //Check if the file is JPEG image and it's size is less than 350Kb $filename = basename($_FILES['uploaded_file1']['name']); $ext = strtolower(substr($filename, strrpos($filename, '.') + 1)); //echo $ext."<br>"; $inmex=date("Ymd")."_".date("His")."_".$filename; //echo $filename."<br>"; if ((($ext == "zip") || ($ext == "rar")) && ($_FILES["uploaded_file1"]["size"] < 17000000)) { $newname = 'uploaded_files/'.$inmex; $imgspath = 'uploaded_files/'.$inmex; //Check if the file with the same name is already exists on the server if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['uploaded_file1']['tmp_name'],$newname))) { $file_path=SITE_PATH.$newname; /*echo "<font color=#ffffff face=Verdana size=2>It's done! The file has been saved as: <b>".$newname."</b></font>"; $qfind="select * from `tbl_upload_image` where `file_nm`='".$inmex."'"; $rfind=mysql_query($qfind); $rowfind=@mysql_fetch_array($rfind); if(@mysql_num_rows($r)>0) { $qdel="delete from `tbl_upload_image` where `file_id`='".$rowfind['file_id']."'"; $rdel=mysql_query($qdel); } $qinsert="INSERT INTO `tbl_upload_image` (`image_id` , `image_name` ,`image_path`, `image_comment` ) VALUES (NULL , '".$inmex."', '".$imgspath."', '".filter_var( trim($_POST['comment']), FILTER_SANITIZE_STRING)."');"; $rinsert=mysql_query($qinsert); if(!$rinsert) { echo mysql_error(); } else { echo "Image Uploaded Successfully"; }*/ } else { echo "Error: A problem occurred during file upload!"; } } else { echo "Error: File ".$inmex." already exists"; } } else { echo "Error: Only .zip file under 17MB are accepted for upload"; } } else { echo "Error: No file uploaded"; } //End of image uploading $msg="<div style=' font-family:Arial, Helvetica, sans-serif; color:#333333; font-size:12px; font-weight:bold; padding-top:8px; padding-left:20px; width:500px; background:#FFFFFF; padding-right:10px;'> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['email']), FILTER_SANITIZE_STRING)." </div> Email Address :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['name']), FILTER_SANITIZE_STRING)." </div> Name :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['company']), FILTER_SANITIZE_STRING)." </div> Company :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['phone']), FILTER_SANITIZE_STRING)." </div> Phone :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['quantity']), FILTER_SANITIZE_STRING)." </div> Quantity :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['quote_date']), FILTER_SANITIZE_STRING)." </div> Quote Needed Date :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['parts_date']), FILTER_SANITIZE_STRING)." </div> Parts Needed Date :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['material']), FILTER_SANITIZE_STRING)." </div> Material :</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['hardware']), FILTER_SANITIZE_STRING)." </div> Hardware?</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['welding']), FILTER_SANITIZE_STRING)." </div> Welding?</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['finishing']), FILTER_SANITIZE_STRING)." </div> Finishing Requirements? </div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['itar']), FILTER_SANITIZE_STRING)." </div> ITAR Required?</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['special']), FILTER_SANITIZE_STRING)." </div> Special Tolerances</div> <div style=' height:110px;'> <div style='float:right; width:280px; height:100px;'> ".filter_var( trim($_POST['comments']), FILTER_SANITIZE_STRING)." </div> Comments</div> <div style=' height:20px;'> <div style='float:right; width:280px; height:20px;'>"; if($newname!='') { $msg.="<a href='http://www.metalsheetfabrication.com/download.php?file_name=".$newname."' target='_blank'>Download File</a>"; } else { $msg.="No File Uploaded"; } $msg.=" </div> File Uploads</div> <div style=' height:25px; padding-top:10px;'> <div style='float:right; width:280px; height:25px;'> ".filter_var( trim($_POST['how_know']), FILTER_SANITIZE_STRING)." </div> How did you know us?</div> <div style=' height:25px;'> <div style='float:right; width:280px; height:25px;'>".filter_var( trim($_POST['old_customer']), FILTER_SANITIZE_STRING)."</div> Are you old customer?</div> </div>"; $to="andy@royalsunusa.com"; $cc="r_raj_d@yahoo.com"; $from="quote@metalsheetfabrication.com"; $subjectt = "New Quotation Posted : metalsheetfabrication.com"; $headerss = 'MIME-Version: 1.0' . "\r\n"; $headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headerss .= 'To: '.$to. "\r\n"; $headerss .= 'Cc: '.$cc. "\r\n"; $headerss .= 'From:' .$from. "\r\n"; $msg="You have received a new Quotation. Quotation detail is as follows:\n\r\n\r<br><br>\n\r\n\r".$msg; if(mail($to, $subjectt, $msg, $headerss)) { echo "Thanks for your interest.<bt><br>Your Quotation Sent Successfully, We will reply you soon."; } } ?>