mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-08 08:46:03 +00:00
first commit
This commit is contained in:
57
src/feedback.php
Executable file
57
src/feedback.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?
|
||||
/*
|
||||
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);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user