Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]formularz - brak polskich znaków, formularz rejetracyjny
a.quzar
post 11.01.2014, 23:47:14
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 11.01.2014

Ostrzeżenie: (0%)
-----


Witajcie

Jestem początkujący w temacie php dlatego proszę o pomoc:

Jeśli możecie powiedzcie, dlaczego w wiadomościach wysyłane za pomocą tego formularza nie są wyświetlane polskie znaki?



[php][php]<?php

// Your email address
$to = 'moj@mail.pl';

$subject = $_POST['subject'];;

// Don't edit below unless you know what you're doing
if($to) {
$name = $_POST['name'];
$email = $_POST['email'];

$fields = array(
0 => array(
'text' => 'Name',
'val' => $_POST['name']
),
1 => array(
'text' => 'Email address',
'val' => $_POST['email']
),
2 => array(
'text' => 'Message',
'val' => $_POST['message']
)
);

$message = "";

foreach($fields as $field) {
$message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
}

$headers = "MIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\n";
$headers .="Content-Transfer-Encoding: 8bit";
$headers .= "Od: \"" . $name . "\" \r\n";
$headers .= "Odpowiedz do: " . $email . "\r\n";
$message = utf8_decode($message);

mail($to, $subject , $message, $headers);

if ($message){
echo 'sent';
}else{
echo 'failed';
}
} else {
echo "Don't access this file directly";
}
?>
Go to the top of the page
+Quote Post
rad11
post 11.01.2014, 23:59:58
Post #2





Grupa: Zarejestrowani
Postów: 1 270
Pomógł: 184
Dołączył: 7.10.2012
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Najpierw tu:
Link
A potem tu
link1
link2

a na sam koniec tu

Link3

Ten post edytował rad11 12.01.2014, 00:00:44
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 27.06.2025 - 15:39