M
M
maksplotnikoff2016-02-18 15:40:44
MODX
maksplotnikoff, 2016-02-18 15:40:44

Calling a chunk in a snippet?

Guys, good afternoon! Please tell me, I recently started to study Modx, and ran into a small problem. There is a form and handler in php. After submitting the data from the form, a page of gratitude for the answer should open.
I created a snippet that perfectly processes the form and sends everything to the box, but I can’t figure out how to correctly call the chunk. Tell me please!

<?php
if(!empty($_POST['username']) and !empty($_POST['email']) and !empty($_POST['subject']) 
   and !empty($_POST['message'])){
      $name = trim(strip_tags($_POST['username']));
      $email = trim(strip_tags($_POST['email']));
      $subject = trim(strip_tags($_POST['subject']));
      $message = trim(strip_tags($_POST['message']));
 
      mail('[email protected]', 'Новое письмо с сайта ', 
      'Вам написал(а): '.$name.'
      <br />
      Его почтовый адрес: '.$email.'
      <br />
      Тема письма: '.$subject.'
      <br />
      Сообщение: '.$message,
      "Content-type:text/html;charset=UTF-8");
 
      echo header('location:');
 
      exit;
   }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis T, 2016-02-18
@tyukavin_denis

don't bother and install FormIt
bayguzin.ru/main/uroki/uroki-modx-revolution/forma...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question