Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="hidden" name="project_name" value="3wit.ru">
- <input type="hidden" name="admin_email" value="lianaza@mail.ru">
- <input type="hidden" name="form_subject" value="Заявка на кровать">
- $method = $_SERVER['REQUEST_METHOD'];
- //Script Foreach
- $c = true;
- if ( $method === 'POST' ) {
- $project_name = trim($_POST["project_name"]);
- $admin_email = trim($_POST["admin_email"]);
- $form_subject = trim($_POST["form_subject"]);
- foreach ( $_POST as $key => $value ) {
- if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
- $message .= "
- " . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
- <td style='padding: 30px; border: #e9e9e9 1px solid;'><b>$key</b></td>
- <td style='padding: 30px; border: #e9e9e9 1px solid;'>$value</td>
- </tr>
- ";
- }
- }}
- function adopt($text) {
- return '=?UTF-8?B?'.Base64_encode($text).'?=';
- }
- $headers = "MIME-Version: 1.0" . PHP_EOL .
- "Content-Type: text/html; charset=utf-8" . PHP_EOL .
- 'From: '.adopt($project_name).' <lianaza@mail.ru>' . PHP_EOL .
- 'Reply-To: lianaza@mail.ru' . PHP_EOL;
- mail($admin_email, adopt($form_subject), $message, $headers );
Add Comment
Please, Sign In to add comment