Commit 2a5f9f585c8e542e7acefae74680020adf265067

Authored by Eugeny Galkovskiy
1 parent 35cdf1b8

123

Showing 1 changed file with 10 additions and 9 deletions   Show diff stats
www-arktika/email.php
@@ -7,14 +7,15 @@ @@ -7,14 +7,15 @@
7 date_default_timezone_set('Etc/UTC'); 7 date_default_timezone_set('Etc/UTC');
8 require 'PHPMailer/PHPMailerAutoload.php'; 8 require 'PHPMailer/PHPMailerAutoload.php';
9 9
10 - // Читаем содержимое  
11 - $code = 'fdfdfdd';  
12 - $text = file_get_contents("list.php");  
13 - // Переводим содержимое в видимую форму  
14 - $text = htmlspecialchars($text);  
15 - // Выводим содержимое файла  
16 - $text = eval($text);  
17 - die(); 10 + function getContent($code){
  11 + // Читаем содержимое
  12 + $code = 'fdfdfdd';
  13 + $text = file_get_contents("list.php");
  14 + // Переводим содержимое в видимую форму
  15 + $text = htmlspecialchars($text);
  16 + return str_replace("{code}", $code, $text);
  17 +
  18 + }
18 19
19 if(isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['email']) && !empty($_POST['email']) ) { 20 if(isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['email']) && !empty($_POST['email']) ) {
20 21
@@ -62,7 +63,7 @@ if(isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['email']) && @@ -62,7 +63,7 @@ if(isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['email']) &&
62 //Read an HTML message body from an external file, convert referenced images to embedded, 63 //Read an HTML message body from an external file, convert referenced images to embedded,
63 //convert HTML into a basic plain-text alternative body 64 //convert HTML into a basic plain-text alternative body
64 65
65 - $mail->msgHTML(getHtml($code, $email) ); 66 + $mail->msgHTML(getContent($code));
66 $mail->send(); 67 $mail->send();
67 //send the message, check for errors 68 //send the message, check for errors
68 header('Location: http://arktika.semena.in.ua/'); 69 header('Location: http://arktika.semena.in.ua/');