IzKuFeLiQqQqQ
Registered
Здравейте имам тези кодове
contact.php
lite_process.php
lite_settings.php
как да направя да може да се пращат и на бг???
contact.php
Код:
<form name="contactformlite" method="post" action="./files/lite_process.php" onsubmit="return validate.check(this)">
<table width="400px" class="cflite">
<tr>
<td colspan="2">
<p style="text-align:center">Полетата с <span class="required_star"> * </span> са задължителни.</p>
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Full_Name" class="required">Име<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Full_Name" id="Full_Name" maxlength="80" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Email_Address" class="required">Email адрес<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Email_Address" id="Email_Address" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Telephone_Number" class="required">Телефонен номер<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<input type="text" name="Telephone_Number" id="Telephone_Number" maxlength="100" style="width:250px">
</td>
</tr>
<tr>
<td valign="top" class="cflite_td">
<label for="Your_Message" class="required">Вашето съобщение<span class="required_star"> * </span></label>
</td>
<td valign="top" class="cflite_td">
<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 type="submit" value="Submit">
lite_process.php
Код:
<?php header('Content-type: text/html; encoding: UTF-8');
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 "Съжаляваме,но се появиха грешки в формата която попълнихте. ";
echo "Появиха се тези грешки:<br /><br />";
echo $error."<br /><br />";
echo "Моля върнете се и ги поправете.<br /><br />";
die();
}
if(!isset($_POST['Full_Name']) ||
!isset($_POST['Email_Address']) ||
!isset($_POST['Telephone_Number']) ||
!isset($_POST['Your_Message'])) {
died('Съжаляваме,но се появиха грешки в формата която попълнихте.');
}
$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 .= 'Email адреса който въведохте не е валиден.<br />';
}
if(strlen($full_name) < 2) {
$error_message .= 'Името което въведохте не е валидно.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'Съобщението който въведохте не е валиден.<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 .= "Име: ".clean_string($full_name)."\r\n";
$email_message .= "Email: ".clean_string($email_from)."\r\n";
$email_message .= "Телефон: ".clean_string($telephone)."\r\n";
$email_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>
<?php
}
?>
lite_settings.php
Код:
<?php header('Content-type: text/html; encoding: UTF-8');
$email_to = "plambata95@abv.bg"; // your email address
$email_subject = "Contact Form Message"; // email subject line
$thankyou = "thankyou.php"; // thank you page
?>
та въпроса ми е защо не мога да пращам съобщения на български пробвах header да сложа екондинга на страницата е utf8 без БОМ но съобщенията ги получавам така[quote] Form details below.
Име: пламен
Email: plambata95@abv.bg
Телефон: 0883141652542
Съобщение: здравеййййй[/quote]