Before contacting me and asking a question, please click the blog link and use the search form on the left hand side menu to search for possible answers to any questions you have.
(($FILE_UPLOAD_MAX*1024)*1024)){ $message = 'File is over '.$FILE_UPLOAD_MAX.' MB in size.';} if($message == NULL && allowed_ext($FILE_UPLOADS_EXT,$_FILES['user_file']['name']) == false){$message = 'Invalid extension.';} $new_filename = date("G_i_s_").$_FILES['user_file']['name']; } //Image verificaiton checks if($message == NULL && $IMAGE_VERIFICATION == 1){ $te_co = hex2bin($_POST['hid_code']); $word_is = RC4($te_co,$IMAGE_VER_CODE); if($word_is != $_POST['confirm_image']){$message = 'Your verfication code is incorrect.';} } //End verifications, start processing if($message == NULL){ //Check if file upload is needed if($FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){ //Store file for keep and email move_uploaded_file($_FILES['user_file']['tmp_name'],$FILE_UPLOADS_DIR.$new_filename); } //compose admin/user message templates replaces $do_search = array('$+name+$','$+email+$','$+message_text+$','$+reason+$'); $do_replace = array($_POST['name'],$_POST['email'],$_POST['message_text'],$_POST['reason']); //Send user email? if($SEND_THANKS == 1){ $user_message = str_replace($do_search,$do_replace,$USER_TEMPLATE); //Set Headers $user_header = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; $user_header .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; $user_header .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n"; //Send Thank you mail ($_POST['email'],$EMAIL_OPTIONS['USER_SUBJECT'],$user_message,$user_header); } //Send admi email? if(count($ADMIN_EMAILS) > 0){ $admin_message = str_replace($do_search,$do_replace,$ADMIN_TEMPLATE); //Do we need to send file as attachment? if($FILE_DO != 1){ //Get file attriubtes $fileatt_type = $_FILES['user_file']['type']; $file = fopen($FILE_UPLOADS_DIR.$new_filename,'rb'); while($dat = fread($file,1025657)){ $attachment_data .= $dat; } fclose($file); // Encode file content $attachment_data = chunk_split(base64_encode($attachment_data)); //File upload headers $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // Add a multipart boundary above the plain message $new_message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=\"".$EMAIL_OPTIONS['CHARSET']."\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $admin_message . "\n\n"; // Add file attachment to the message $new_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$new_filename}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$new_filename}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $attachment_data . "\n\n" . "--{$mime_boundary}--\n"; unset($attachment_data); } else { //regular headers $headers = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; $headers .= "From: $email\r\n"; //$headers .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n"; $headers .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n"; $new_message = $admin_message; } //Send admin emails foreach($ADMIN_EMAILS as $this_email){ mail ($this_email,$EMAIL_OPTIONS['ADMIN_SUBJECT'],$new_message,$headers); } } //Remove file if not needed if($FILE_DO == 2){ unlink($FILE_UPLOADS_DIR.$new_filename); } header("Location: http://www.lovepeaceproject.com/contactsuccess.html"); $_POST = NULL; } } if($message != NULL){ ?>
| =$message;?> |
Before contacting me and asking a question, please click the blog link and use the search form on the left hand side menu to search for possible answers to any questions you have.