Есть форма отправки сообщения, есть поле email, из него нужно сделать поле с телефоном, и что бы телефон был в письме вместе с сообщением:
$json = array();
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
if ((utf8_strlen($this->request->post['cf_email']) < 2) || (utf8_strlen($this->request->post['cf_email']) > 60)) {
$json['error'] = $this->language->get('error_email');
}
if ((utf8_strlen($this->request->post['cf_text']) < 5) || (utf8_strlen($this->request->post['cf_text']) > 1000)) {
$json['error'] = $this->language->get('error_message');
}
if (empty($this->session->data['captcha_contact_form']) || ($this->session->data['captcha_contact_form'] != $this->request->post['cf_captcha'])) {
$json['error'] = $this->language->get('error_verification');
}
unset($this->session->data['captcha_contact_form']);
if (!isset($json['error'])) {
$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->request->post['cf_email']);
$mail->setSender(html_entity_decode($this->request->post['cf_name'], ENT_QUOTES, 'UTF-8'));
$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['cf_name']), ENT_QUOTES, 'UTF-8'));
$mail->setText($this->request->post['cf_text']);
$mail->send();
$json['success'] = $this->language->get('text_success');
}
}
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
`
Изменил:
if `((utf8_strlen($this->request->post['cf_phone']) < 2) ||
(utf8_strlen($this->request->post['cf_phone']) > 60)) {
$json['error'] = $this->language->get('error_phone');
}`
Но как заставить его выводить сюда $mail->setText($this->request->post['cf_text']);
?
Кофе для программистов: как напиток влияет на продуктивность кодеров?
Рекламные вывески: как привлечь внимание и увеличить продажи
Стратегії та тренди в SMM - Технології, що формують майбутнє сьогодні
Выделенный сервер, что это, для чего нужен и какие характеристики важны?
Современные решения для бизнеса: как облачные и виртуальные технологии меняют рынок
Почему возникает ошибка PHP Fatal error: Class 'user\login\SystemCommand\DateTime' not found in
На ноуте установлен серве XAMPP и он работает вполне отлично, на телефоне https://bitbucketorg/esminis/server/wiki/Home из этой серии Server for PHP (PHP) и MariaDB Server (MariaDB)
Скажите пожалуйста, вот у меня есть форма авторизации, классика логин и пароль, и можно как-то один раз авторизоваться по логину и паролю,...
Доброго времени суток, у меня на главной странице есть форма отправки вопроса, к ней подключена обычная google recaptcha v2, всё работает отлично,...