示例#1
0
文件: review.php 项目: gblok/rsc
    $referrer = $_REQUEST['referrer'];
    $userName = $_REQUEST['name'];
    $userLastName = $_REQUEST['lastname'];
    $userPhone = $_REQUEST['phone'];
    $userEmail = $_REQUEST['email'];
    $userReview = $_REQUEST['review'];
    $name = 'robot';
    $email = 'robot@' . $_SERVER['SERVER_NAME'];
    $subject = 'REVIEW -> ' . $_SERVER['SERVER_NAME'];
    $message = "ОТЗЫВ" . " \n";
    $message .= "дата отправки: " . date("d.m.y") . " \n";
    $message .= "\n---------------------------------------------------------------- \n\n";
    $message .= "Имя: " . $userName . " \n";
    $message .= "Фамилия: " . $userLastName . " \n";
    if (!empty($userPhone)) {
        $message .= "Контактный телефон: " . $userPhone . " \n";
    }
    $message .= "e-mail: " . $userEmail . " \n\n";
    $message .= "\n---------------------------------------------------------------- \n\n";
    $message .= $userReview . " \n\n";
    if (!empty($referrer)) {
        $message .= "\n---------------------------------------------------------------- \n\n";
        $message .= "отправлено со страницы \n";
        $message .= "http://" . $_SERVER['HTTP_HOST'] . $referrer;
    }
    if (xMailTxtHTML(CONF_GENERAL_EMAIL, $subject, $message, $email, $name)) {
        $response = array('tit' => 'Сообщение отправлено', 'hint' => 'Спасибо, отзыв появится на сайте в ближайшее время.');
    }
    echo json_encode($response);
}
exit;
示例#2
0
文件: feedback.php 项目: gblok/rsc
     if (CONF_ENABLE_CONFIRMATION_CODE) {
         $error_f = 1;
         if (!$_POST['fConfirmationCode'] || !isset($_SESSION['captcha_keystring']) || $_SESSION['captcha_keystring'] !== $_POST['fConfirmationCode']) {
             $error_f = 2;
             $smarty->assign("error", $error_f);
         }
         unset($_SESSION['captcha_keystring']);
         if ($error_f == 1) {
             if (xMailTxtHTML(CONF_GENERAL_EMAIL, $message_subject, $message_text, $customer_email, $customer_name)) {
                 Redirect("index.php?feedback=1&sent=1");
             } else {
                 $smarty->assign("error", 3);
             }
         }
     } else {
         if (xMailTxtHTML(CONF_GENERAL_EMAIL, $message_subject, $message_text, $customer_email, $customer_name)) {
             Redirect("index.php?feedback=1&sent=1");
         } else {
             $smarty->assign("error", 3);
         }
     }
 } else {
     if (isset($_POST["feedback"])) {
         $smarty->assign("error", 1);
     }
 }
 //extract input to Smarty
 $smarty->hassign("customer_name", $customer_name);
 $smarty->hassign("customer_email", $customer_email);
 $smarty->hassign("message_subject", $message_subject);
 $smarty->hassign("message_text", $message_text);