Контактна форма

ianis-build

Active member
Здравейте!
Настроих си outlook 2007 за да си проверявам пощата.
И като изпратя съобщение от контактната форма на сайта ми (http://ianis-build.eu/contactform.html) ми излизат пак на кирилица но не се разчитат а иначе в контролния панел на icn всичко е ок и от други имейли като получа съобщение всичко е ок.
Въпросът ми е следния дали контактната форма кодира съобщенията така че да немогат да се разчетат от outlook и как мога да го оправя.

Пример:
Съобщението "Здравейте Асен Янков" се вижда така "ГДПЮБЕХРЕ ЮЯЕМ ЪМЙНБ"
 
Последно редактирано:
Re: Контактна форма

Това е кода на контактната форма.

HTML:
<html><head><title>Контакти - Ianis-Build</title>

  <meta http-equiv="content-type" content="text/html; charset=windows-1251">
 
  
  <script src="lite_validation.js"></script>
  
  <script>
required.add('Full_Name','NOT_EMPTY','Моля попълнете име');
required.add('Email_Address','EMAIL','Невалиден e-mail');
required.add('Your_Message','NOT_EMPTY','Моля попълнете съобщение')
  </script>
  
  <link rel="stylesheet" type="text/css" href="lite_styles.css">
</head>
<body>
<div id="hr1" style="overflow: hidden; position: absolute; left: 9px; top: 277px; width: 762px; height: 17px; z-index: 10;">
<hr size="2" width="762"></div>
<div id="html2" style="overflow: hidden; position: absolute; left: 25px; top: 415px; width: 412px; height: 300px; z-index: 11;">
<form name="contactformlite" method="post" action="lite_process.php" onsubmit="return validate.check(this)">
  <table style="left: 65px; width: 414px;" class="cflite">
    <tbody>
      <tr style="font-weight: bold; color: rgb(204, 102, 0);">
        <td colspan="2">
        <p style="text-align: center;">Контактана форма</p>
        </td>
      </tr>
      <tr>
        <td style="color: rgb(255, 102, 0);" class="cflite_td" valign="top"> <label for="Full_Name" class="required">Вашето име<span class="required_star"> * </span></label> </td>
        <td class="cflite_td" valign="top"> <input name="Full_Name" id="Full_Name" maxlength="80" style="width: 250px;" type="text"> </td>
      </tr>
      <tr>
        <td style="color: rgb(255, 102, 0);" class="cflite_td" valign="top"> <label for="Email_Address" class="required">Email адрес<span class="required_star"> * </span></label> </td>
        <td class="cflite_td" valign="top"> <input name="Email_Address" id="Email_Address" maxlength="100" style="width: 250px;" type="text"> </td>
      </tr>
      <tr>
        <td style="color: rgb(103, 194, 246);" class="cflite_td" valign="top"> <label for="Telephone_Number" class="not-required ws11" color="#409fff">Телефонен
номер</label> </td>
        <td class="cflite_td" valign="top"> <input name="Telephone_Number" id="Telephone_Number" maxlength="100" style="width: 250px;" type="text"> </td>
      </tr>
      <tr>
        <td style="color: rgb(255, 102, 0);" class="cflite_td" valign="top"> <label for="Your_Message" class="required">Вашето
съобщение<span class="required_star"> * </span></label> </td>
        <td class="cflite_td" valign="top"> <textarea style="width: 250px; height: 120px;" name="Your_Message" id="Your_Message" maxlength="2000"></textarea> </td>
      </tr>
      <tr>
        <td colspan="2" style="text-align: center;" class="cflite_td"> <input value=" Изпрати " type="submit"> <br>
        <br>
        <br>
        <br>
        </td>
      </tr>
    </tbody>
  </table>
</form>
</div>
</body>
 
Re: Контактна форма

Постни кода на lite_process.php файла
Много ти благодаря за това че ми помагаш.
PHP:
<?php
// URL: www.freecontactform.com
// Version: FreeContactForm Lite V1.1
// Copyright (c) 2010 Stuart Cochrane <stuartc1@gmail.com>
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
if(isset($_POST['Email_Address'])) {
	
	include 'lite_settings.php';
	
	if($email_to == "youremailaddress@yourdomain.com") {
		die("This message is for the Webmaster. Please enter your email address into the file 'lite_settings.php'");
	}
	
	function died($error) {
		echo "Sorry, but there were error(s) found with the form you submitted. ";
		echo "These errors appear below.<br /><br />";
		echo $error."<br /><br />";
		echo "Please go back and fix these errors.<br /><br />";
		die();
	}
	
	if(!isset($_POST['Full_Name']) ||
		!isset($_POST['Email_Address']) ||
		!isset($_POST['Telephone_Number']) ||
		!isset($_POST['Your_Message'])) {
		died('We are sorry, but there appears to be a problem with the form you submitted.');		
	}
	
	$full_name = $_POST['Full_Name']; // required
	$email_from = $_POST['Email_Address']; // required
	$telephone = $_POST['Telephone_Number']; // not required
	$comments = $_POST['Your_Message']; // required
	
	$error_message = "";
	$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
  if(!eregi($email_exp,$email_from)) {
  	$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
  if(strlen($full_name) < 2) {
  	$error_message .= 'Your Name does not appear to be valid.<br />';
  }
  if(strlen($comments) < 2) {
  	$error_message .= 'The Comments you entered do not appear to be valid.<br />';
  }
  
  if(strlen($error_message) > 0) {
  	died($error_message);
  }
	$email_message = "Form details below.\r\n";
	
	function clean_string($string) {
	  $bad = array("content-type","bcc:","to:","cc:","href");
	  return str_replace($bad,"",$string);
	}
	
	$email_message .= "Full Name: ".clean_string($full_name)."\r\n";
	$email_message .= "Email: ".clean_string($email_from)."\r\n";
	$email_message .= "Telephone: ".clean_string($telephone)."\r\n";
	$email_message .= "Message: ".clean_string($comments)."\r\n";
	
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?>
<script>location.replace('<?php echo $thankyou;?>')</script>
<?
}
?>
 
Последно редактирано:
Re: Контактна форма

Добави едно:

Код:
$headers = "Content-type: text/plain; charset=UTF-8;"."\r\n";

и може да се получи
 
Re: Контактна форма

Мерси много получи се самоче с windows-1251.
Sorry, не бях погледнал кодировката на сайта ти. Важното е, че работИ вече. Схванал си идеята.
 
Re: Контактна форма

Тюх изпревариха ме. То човек да не седне да обядва 🙁

Нищо мерси много и на двамата много съм ви благодарен.
 
Последно редактирано:
Re: Контактна форма

За да не отварям нова тема ще пиша в тази.
Като инсталирах офис 2007 ми се се появи един много странен проблем.
Като отворя сайта си или свива java менюто или разширява самия HTML.
Защо се получава така нз да не би офис 2007 да е задал някакви настроики на браузера.
Пробвах и с мозила и ие.
Но от други компютри се вижда нормално.

Преди инсталирането на офис 2007:
menu2.jpg


След инсталирането на офис 2007:
menu1.jpg
 
Последно редактирано:

Back
Горе