Files
graphonline/src/feedback.php
/usr/bin/nano c715e2a604 first commit
2017-04-15 01:34:36 +03:00

57 lines
1.2 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?
/*
Sample page
*/
print_r ($_POST);
$dateFile = "./tmp/dateFeedback.txt";
$mymail = "soft_support@list.ru";
$fh = fopen($dateFile, "r");
$lastTime = 0;
$lastTime = fread($fh, filesize($dateFile));
fclose($fh);
$secondsForPost = 5;
$error = "";
$accept = "";
if (time() - $lastTime > $secondsForPost)
{
$text = $_POST['message'];
$name = $_POST['name'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=utf-8' . "\r\n";
$headers .= "From: support@freeanalogs.ru \r\n";
if (mail($mymail, "Graph feedback", $text . "\n\n" . $name, $headers))
{
$accept = "Ваше предложение отправлено модераторам.<br>";
}
else
{
$error = "Неопределенная ошибка. Свяжитесь с администратором по адресу soft_support@list.ru<br>";
}
$fh = fopen($dateFile, "w");
fwrite($fh, time());
fclose($fh);
$STitle = "";
$softDetail = "";
$webSite = "";
$TTitle = "";
}
else
{
echo (3);
$error = "Сервер перегружен, повторите попытку через 30 секунд.<br>";
}
echo ($error);
echo ($accept);
?>