![]() |
![]() ![]() |
![]() |
![]()
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"; } ?> |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 1 270 Pomógł: 184 Dołączył: 7.10.2012 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 27.06.2025 - 15:39 |