Answer the question
In order to leave comments, you need to log in
What could be the problem with encoding in Joomla?
Hello. Made feedback for the site. Everything works, messages come, but the problem is that they come in krakozyabry. The main thing is that everything is displayed normally in the description of the letter, and when you open the krakozyabry. It's about the encoding, but I checked the same encoding everywhere. How can I fix this so that the message is displayed in Russian letters?
I am attaching parts of the file code (encodings in the file and feedback code)
<?php defined('_JEXEC') or die; header("Content-Type: text/html; charset=utf-8");?>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Закрыть" class="close">X</a>
<h2>Модальное окно</h2>
<form name="MyForm" action="#openModal" method="post"><br>
<input name="name" type="text" placeholder="Имя" /><br>
<input name="tel" type="phone" placeholder="Телефон" /><br>
<input name="email" type="email" placeholder="Email" /><br>
<textarea name="body" placeholder="Ваше сообщение"></textarea><br>
<input type="submit" value="Отправить заявку" id="btnpng4" />
</form>
<?php
if (isset($_POST["email"])){
if (isset($_POST["name"])) {$name = $_POST["name"];}
if (isset($_POST["email"])) {$email = $_POST["email"];}
if (isset($_POST["tel"])) {$tel = $_POST["tel"];}
if (isset($_POST["body"])) {$body = $_POST["body"];}
if($name=="" or $email=="" or $tel=="" or $body==""){ // Проверяем на заполненность всех полей.
echo "Заполните все поля";
}else{
$ip=$_SERVER["REMOTE_ADDR"]; // Вычисляем ip пользователя
$brose=$_SERVER["HTTP_USER_AGENT"]; // Вычисляем браузер пользователя
$to = "email"; // Ваш email адрес
$subject = "Сообщение c сайта СибКом"; // тема письма
$headers .= "Content-Type: text/html; charset=utf-8";
$headers .= "From: Создание сайтов Trust Code"; // Отправитель письма
$message = "
Имя: $name<br>
E-mail: $email<br>
Телефон: $tel<br>
Текст: $body<br><br>
IP отправителя: $ip<br>
Браузер отправителя: $brose<br>
";
$send = mail($to, $subject, $message, $headers);
if ($send == "true")
{
echo "Ваше сообщение отправлено. Мы ответим вам в ближайшее время.";
}
else
{
echo "Не удалось отправить, попробуйте снова!";
}
}
}
?>
</div>
</div>
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