Фриланс
- 1 ответ
- 0 вопросов
2
Вклад в тег
$datet=date('d-m-Y',time());
@Header("Content-Type: text/plain; charset=utf-8");
$timet=date('H:i');
$text=htmlspecialchars(str_replace(";",".,",urldecode("{$_POST['text']}")));
$name=strip_tags(str_replace(";",".,",urldecode("{$_POST['name']}")));
$email=strip_tags(str_replace(";",".,",urldecode("{$_POST['email']}")));
$text=str_replace("\\"," ",$text);
$text=str_replace("\r"," ",$text);
$text=str_replace("\n"," ",$text);
$ip = $_SERVER['REMOTE_ADDR'];
mail("email@email.com", "Сообщение с сайта", "Форма $form\n$name\n$email\n$text\n\n$timet\n$datet\nIP: $ip");
$res="<tr><td>$datet</td><td>$timet</td><td>*$ip*</td><td>$name</td><td><b>$email</b></td><td>Текст: $text</td></tr>";
$fp = fopen("feedback.txt", "r");
if ($fp) $text= fgets($fp);
fclose($fp);
$fp=fopen("feedback.txt","w");
fwrite($fp,"$res$text");
fclose($fp);