Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 1.0/2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 01.07.2009, 14:36
Art_133 вне форума Посмотреть профиль Отправить личное сообщение для Art_133 Посетить домашнюю страницу Art_133 Найти все сообщения от Art_133
  № 1  
Ответить с цитированием
Art_133
 
Аватар для Art_133

блогер
Регистрация: Feb 2007
Адрес: Москва
Сообщений: 538
Записей в блоге: 2
Отправить сообщение для Art_133 с помощью Skype™
По умолчанию Контактная форма от Template Monsters не отправляет русский текст

Всем привет. Даже не знаю где примерно копать...
Есть шаблон от TM. Там контактная форма деланна компонентом который работает с полями, кнопками в шаблоне и внешними файлами: contact.asp, contact.php, form05configuration.xml, form05structure.xml.
Английские символы отправляются хорошо, а вот русские приходят вот так "аа".
Все xml файлы сохранены с кодировкой UTF-8

Вот код каждого отдельного файла:
contact.asp
Код:
<%
'----function that removes html tags-----------
   Function RemoveHTML( strText )
		Dim RegEx
		Set RegEx = New RegExp
		RegEx.Pattern = "<[^>]*>"
		RegEx.Global = True
		RemoveHTML = RegEx.Replace(strText, "")
	End Function
'---------------------------------------------
   
'------defining script vars-------------------
   Dim mailObj, mailCfg, myBody, fld 

	Dim RegEx 
    set RegEx = New RegExp
'--------------------------------------------

'------getting data sent by flash (filtering configuration data)------------
   For Each fld in Request.Form
      If Request.Form(fld) <> "" and _
      fld <> "mail_to" and _
	  fld <> "smtp_server" and _
	  fld <> "smtp_port" and _
	  fld <> "plain_text" and _
	  fld <> "mail_from" and _
      fld <> "mail_subject" Then
         myBody = myBody & vbCRLF & "   <b>" & fld & "</b> :<br/> " & Trim(Request.Form(fld)) & "<br/>"
      End If
   Next
'---------------------------------------------------------------------------

'----------setting conf data------------------------------------------------
	On Error Resume Next
		Set myMail = CreateObject("CDO.Message") 
		myMail.Subject = Request.Form("mail_subject")
		myMail.From =Request.Form("mail_from")
		myMail.To = Request.Form("mail_to")
		
'--------if plain text is set to true removing html---------------------------------------		
		if Request.Form("plain_text") = "true" then 
			
			myMail.TextBody = RemoveHTML(myBody)

'-------otherwise composing message body--------------------------------------------------			
			else myMail.HTMLBody = "<html><body>" & myBody & "</body></html>"
			
		end if
'----------setting configuration params for smtp----------------------------------------------------------------------------------
		myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
		myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Request.Form("smtp_server")
		myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Request.Form("smtp_port")
		myMail.Configuration.Fields.Update 
'---------------------------------------------------------------------------------------------------------------------------------		
		myMail.Send '---------------sending message
  
   If Err = 0 Then
   Response.Write("&mail=1") 'if there the message is sent return 1 to flash
   Else
   Response.Write("&mail=0") 'otherwise return 0
   End If
   
%>

contact.php
Код:
<?php
//-----------------Getting data sent by flash---------------------
foreach ($_POST as $key => $value){

		if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){
	
			$mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>';
	
			$mail_body .= ''.stripslashes($value).'<br/>';
		}
}
//-----------------------------------------------------------------



$message = '<html><body>'.$mail_body.'</body></html>'; //  mail body

//------------if plain text is set to true removing html tags------
if ($_POST['plain_text']=='true') {

	$message = str_replace('<br/>',"\r\n", $message);

	$message = strip_tags($message);

//------------------------------------------------------------------
} else {
//----otherwise composing message headers---------------------------
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	
	$headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n";
//------------------------------------------------------------------
}

//------------setting conf data-------------------------------------
$to = $_POST['mail_to'];

$from = $_POST['mail_from'];

$subject = $_POST['mail_subject'];

$smtp_server = $_POST['smtp_server'];

$smtp_port = $_POST['smtp_port'];
//------------------------------------------------------------------

//---------setting header info--------------------------------------


$headers .= 'From:' .$from;
//------------------------------------------------------------------


if (mail($to, $subject, $message, $headers)){ // sending mail

	print('&mail=1');  //succes

} else {

	print('&mail=0');//failure

}

?>
form05configuration.xml
Код этого файла не поместился т.к. много текста....

form05structure.xml
Код:
<?xml version="1.0" encoding="utf-8"?>
<contactFormStructure>
	
	<formItems>
 
		<item id="1" label="Name" required="true">
			<textToShow></textToShow>
		</item>

		<item id="2" label="E-mail" required="true">
			<textToShow></textToShow>
			<validator>EmailValidator</validator>
		</item>

		<item id="3" label="Message" required="true">
			<textToShow></textToShow>
		</item>

	</formItems>
	
</contactFormStructure>
Ума не приложу где и что нужно исправлять... Подскажите пожалуйста как решить проблему?

Все файлы прилагаю.
Вложения
Тип файла: rar TM Mail.rar (245.7 Кб, 96 просмотров)

Создать новую тему Ответ Часовой пояс GMT +4, время: 16:10.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 16:10.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.