Brak polskich lirer w formularzu flash+php = ZNOWU
: sob cze 16, 2007 5:50 pm
Juz raz mialem ten problem ale nagrle caly formularz przesla mi wogole wysylac. Mam nowy kon PHP , wysyla maila ale bez "naszych" znakow.
Prosze o pomoc ( najlepiej napisanie poprawionego kodu ).
Bede wdzieczny
[php]<?php
<?
$adminaddress = "[email protected]";
$siteaddress ="http://moja_strona.pl";
$sitename = "Moja Strona";
$date = date("m/d/Y H:i:s");
$header = "MIME-Version: 1.0\n";
$header .= "From: $adminaddress\n";
$header .= "Content-Type: TEXT/plain; CHARSET=iso-8859-2\n";
$header .= "Content-Transfer-Encoding: 8bit";
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
$comments = iconv("UTF-8","ISO-8859-2",$comments);
$name = iconv("UTF-8","ISO-8859-2",$name);
$lname = iconv("UTF-8","ISO-8859-2",$lname);
$firma = iconv("UTF-8","ISO-8859-2",$firma);
$city = iconv("UTF-8","ISO-8859-2",$city);
// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$lname = $HTTP_POST_VARS['lname'] ;
$name = $HTTP_POST_VARS['name'] ;
$city = $HTTP_POST_VARS['city'] ;
$telno = $HTTP_POST_VARS['telno'] ;
$comments = $HTTP_POST_VARS['comments'] ;
$firma = $HTTP_POST_VARS['firma'] ;
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action == "send") {
//
mail ("$adminaddress","Zapytanie z Mojej Strony",
"Wiadomość nadesłana z $sitename\n
Imię: $name
Nazwisko : $lname
Nazwa Firmy: $firma
Email: $email
Telefon: $telno
Miasto: $city\n
Tekst:
------------------------------
$comments
------------------------------
Date/Time: $date","FROM:$adminaddress" ) ;
//This sends a confirmation to your visitor
mail ("$email","Potwierdzenie wysłania zapytania z $sitename",
"Witam $name,\n
Dziękujemy za wizyte na stronie $sitename
Odpiszemy w najbliższym czasie. \n
Z poważaniem
$sitename
$siteaddress","FROM:$adminaddress") ;
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Zapytanie wyslane. Odpowiemy w najblizszym czasie.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} //
?>
?>[/php]
Prosze o pomoc ( najlepiej napisanie poprawionego kodu ).
Bede wdzieczny
[php]<?php
<?
$adminaddress = "[email protected]";
$siteaddress ="http://moja_strona.pl";
$sitename = "Moja Strona";
$date = date("m/d/Y H:i:s");
$header = "MIME-Version: 1.0\n";
$header .= "From: $adminaddress\n";
$header .= "Content-Type: TEXT/plain; CHARSET=iso-8859-2\n";
$header .= "Content-Transfer-Encoding: 8bit";
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);
$comments = iconv("UTF-8","ISO-8859-2",$comments);
$name = iconv("UTF-8","ISO-8859-2",$name);
$lname = iconv("UTF-8","ISO-8859-2",$lname);
$firma = iconv("UTF-8","ISO-8859-2",$firma);
$city = iconv("UTF-8","ISO-8859-2",$city);
// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$email = $HTTP_POST_VARS['email'] ;
$lname = $HTTP_POST_VARS['lname'] ;
$name = $HTTP_POST_VARS['name'] ;
$city = $HTTP_POST_VARS['city'] ;
$telno = $HTTP_POST_VARS['telno'] ;
$comments = $HTTP_POST_VARS['comments'] ;
$firma = $HTTP_POST_VARS['firma'] ;
//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action == "send") {
//
mail ("$adminaddress","Zapytanie z Mojej Strony",
"Wiadomość nadesłana z $sitename\n
Imię: $name
Nazwisko : $lname
Nazwa Firmy: $firma
Email: $email
Telefon: $telno
Miasto: $city\n
Tekst:
------------------------------
$comments
------------------------------
Date/Time: $date","FROM:$adminaddress" ) ;
//This sends a confirmation to your visitor
mail ("$email","Potwierdzenie wysłania zapytania z $sitename",
"Witam $name,\n
Dziękujemy za wizyte na stronie $sitename
Odpiszemy w najbliższym czasie. \n
Z poważaniem
$sitename
$siteaddress","FROM:$adminaddress") ;
//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Zapytanie wyslane. Odpowiemy w najblizszym czasie.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
} //
?>
?>[/php]