Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]contact form - problemy z polskimi znakami
mobik
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 29.05.2008

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


witam,

skrypt ktory wysyla zapytanie nie pokazuje polskich znakow w outlook a jak wysylam na gmail.com to polskie znaki sa. do tego ten skrypt nie przesyla informacji ktore sa wprowadzone przez klienta w formularzu, dlaczego?

podaje skrypt:

<?php
$DEFAULT_EXIT_PAGE = "wyslane.html";

$imie = $_POST['Imie i Nazwisko'];
$firma = $_POST['Nazwa Firmy'];
$telefon = $_POST['Telefon'];
$email = $_POST['Email'];
$typ_kabla = $_POST['Typ Kabla'];
$konstrukcja = $_POST['Konstrukcja'];
$wtyczka = $_POST['Wtyczka'];
$dlugosc = $_POST['Długo¶ć'];
$kolor = $_POST['Kolor'];
$ilosc = $_POST['Ilo¶ć'];
$wiadomosc = $_POST['Wiadomosc'];

$wiadomosc = stripslashes($wiadomosc);

$sendTo = "ask@me.pl";
$subject = "Zapytanie ze strony www";

$msg_body = "Imie: $imie<br />";
$msg_body .= "Firma: $firma<br />";
$msg_body .= "Telefon: $telefon<br />";
$msg_body .= "Email: $email<br />";
$msg_body .= "Typ kabla: $typ_kabla<br />";
$msg_body .= "Konstrukcja: $konstrukcja<br />";
$msg_body .= "Wtyczka: $wtyczka<br />";
$msg_body .= "Długo¶ć: $dlugosc<br />";
$msg_body .= "Kolor: $kolor<br />";
$msg_body .= "Ilo¶ć: $ilosc<br />";
$msg_body .= "Wiadomo¶ć: $wiadomosc<br />";

$header_info = 'From: '.$imie.' <'.$wiadomosc.'>'."\r\n";
$header_info .= 'To: '.$sendTo."\r\n";
$header_info .= 'MIME-Version: 1.0'."\r\n";
$header_info .= 'Content-Type: text/html; charset=iso-8859-2'."\r\n";

mail($sendTo, $subject, $msg_body, $header_info);

if(! $exit_page)
$exit_page = $DEFAULT_EXIT_PAGE;
Header("Location: ".$exit_page);

?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nevt
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

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


wg mnie? ja sobie napisałem cos takiego:
  1. <?php
  2. /* -------------------------------------------------------------------------
  3.  Klasa ns_mail - obiekt e-mail
  4.  (c) 2008, developed by NETsoft - Leszek Szamocki
  5.  v.08.15b
  6.    ------------------------------------------------------------------------- */
  7.  
  8. class ns_mail
  9. {
  10. private $mail_to;
  11. private $mail_from;
  12. private $title;
  13. private $content;
  14. private $headers;
  15. private $stamp;
  16.  
  17. public function __construct($mail_to, $title, $mail_from = '')
  18. {
  19. $this->mail_to = $mail_to;
  20. $this->mail_from = $mail_from;
  21. $this->title = $title;
  22. $this->content = '';
  23. $this->headers = '';
  24. srand((double)microtime()*1000000); 
  25. $this->stamp = md5(uniqid(rand())); 
  26. $this->content = '';
  27. $this->headers = "From: $mail_from\n"; 
  28. $this->headers .= "MIME-Version: 1.0\n"; 
  29. $this->headers .= "Content-Type: multipart/mixed;\n"; 
  30. $this->headers .= "\tboundary=\"___$this->stamp==\""; 
  31. }
  32.  
  33. public function add_text($content)
  34. {
  35. $this->content .= "--___$this->stamp==\n"; 
  36. $this->content .= "Content-Type: text/plain; charset=\"utf-8\"\n"; 
  37. $this->content .= "Content-Transfer-Encoding: 8bit\n"; 
  38. $this->content .= "\n$content\n"; 
  39. }
  40.  
  41. public function add_file($name, $file)
  42. {
  43. if (is_uploaded_file($file)) 
  44. { 
  45. $this->content .="--___$this->stamp==\n"; 
  46. $this->content .="Content-Type: application/octet-stream\n"; 
  47. $this->content .="Content-Disposition: attachment;\n"; 
  48. $this->content .=" filename=\"$name\"\n"; 
  49. $this->content .="Content-Transfer-Encoding: base64\n\n"; 
  50. $f = fopen($file,"rb"); 
  51. $data = fread($f,filesize($file)); 
  52. fclose($f); 
  53. $this->content .= chunk_split(base64_encode($data)); 
  54. $this->content .="--___$this->stamp==--\n"; 
  55. }
  56. }
  57.  
  58. public function send()
  59. {
  60. return @mail($this->mail_to,$this->title,$this->content,$this->headers);
  61. }
  62. }
  63. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 19:33