Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question