spacialek
asked on
PHP contact form in Flash with iso-8859-1 charset
I have made a flash contact form in PHP and everything is working fine, I receive the emails sent by the form, the only problem is that I'm french speaking and the content often includes special characters such as "è, é, à, ê, ..." and I they are displaying like that instead : Ã, ©, ...
below is my php code, I inserted a line to the header to tell that my charset is iso-8859-, but it doesn't work at all. I also changed the charset to the page containing the flash movie, but it doesn't work either.
below is my php code, I inserted a line to the header to tell that my charset is iso-8859-, but it doesn't work at all. I also changed the charset to the page containing the flash movie, but it doesn't work either.
<?php
$sendTo = "test@test.com";
$subject = "subject";
$headers = "From: " . $_POST["FirstName"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$headers .= 'Content-type: text/html; charset=iso-8859-1';
$message = $_POST["ToComments"];
mail($sendTo, $subject, $message, $headers);
?>
surely it has to display now.. with this encoding charset...
also check mbstring configuration is enabled.. in order to display those french chars
ASKER
changing the charset to utf-8 doens't help..
where can I check if mbstring configuration is enabled ?
thanks !
where can I check if mbstring configuration is enabled ?
thanks !
where can I check if mbstring configuration is enabled ?
>> just print phpinfo() and check search mbstring* ... you should find the configuration settings...
mbstring
=========
Multibyte Support enabled
Japanese support enabled
Simplified chinese support enabled
Traditional chinese support enabled
Korean support enabled
Russian support enabled
Multibyte (japanese) regex support enabled
>> just print phpinfo() and check search mbstring* ... you should find the configuration settings...
mbstring
=========
Multibyte Support enabled
Japanese support enabled
Simplified chinese support enabled
Traditional chinese support enabled
Korean support enabled
Russian support enabled
Multibyte (japanese) regex support enabled
ASKER
I asked to the technical support of my web hosting, and they confirm that mbstring is enabled...
can you check whether those french character are entered valid ... ?
try put some sample french texts and display it...
it might work for utf-8 encoding o...
try put some sample french texts and display it...
it might work for utf-8 encoding o...
ASKER
yes the characters are valid, I use french sentences for testing, either with utf-8 and iso-8859-1
mmm.... not sure...
hope checked here also, $headers .= 'Content-type: text/html; charset=iso-8859-1';
(the utf-8)
--------------------------
then you can check this without Flash for just verification ..., i have worked with one multilingual feedback form to display those unicode character display.. not sure.....
sorry... i could not suggest further.,
hope checked here also, $headers .= 'Content-type: text/html; charset=iso-8859-1';
(the utf-8)
--------------------------
then you can check this without Flash for just verification ..., i have worked with one multilingual feedback form to display those unicode character display.. not sure.....
sorry... i could not suggest further.,
ASKER
I don't understand what you mean by that : "hope checked here also, $headers .= 'Content-type: text/html; charset=iso-8859-1'; (the utf-8)"
the problem comes only when I use a flash form, I did I the past html forms without encoding problems...
the problem comes only when I use a flash form, I did I the past html forms without encoding problems...
ok.,
did you try this,
$headers .= 'Content-type: text/html; charset=utf-8';
(it might work, this what i already expressed)
did you try this,
$headers .= 'Content-type: text/html; charset=utf-8';
(it might work, this what i already expressed)
ASKER
of course, it was the first thing that I did when I readed you first post :) but it didn't solved the problem
Is it possible to print the values after posting from FLASH contact form? some thing like this,
print '<pre>';
print_r ($_POST);
print '<pre>';
check whether the chars are displayed properly or not
print '<pre>';
print_r ($_POST);
print '<pre>';
check whether the chars are displayed properly or not
ASKER
I'm sorry but I don't know where to write those "print" commands ... Do I have to write them into my php contact form or elsewhere ?
in the process php page.. .might be before you send the mail...
<?php
print '<pre>';
print_r ($_POST);
print '<pre>';
exit;
$sendTo = "test@test.com";
$subject = "subject";
$headers = "From: " . $_POST["FirstName"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$headers .= 'Content-type: text/html; charset=iso-8859-1';
$message = $_POST["ToComments"];
mail($sendTo, $subject, $message, $headers);
?>
>>> check here, whether the content is still correct before we send it to mail... just check .. if problem here.. then we have look those flash input control encoding or something to be applied..
<?php
print '<pre>';
print_r ($_POST);
print '<pre>';
exit;
$sendTo = "test@test.com";
$subject = "subject";
$headers = "From: " . $_POST["FirstName"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$headers .= 'Content-type: text/html; charset=iso-8859-1';
$message = $_POST["ToComments"];
mail($sendTo, $subject, $message, $headers);
?>
>>> check here, whether the content is still correct before we send it to mail... just check .. if problem here.. then we have look those flash input control encoding or something to be applied..
ASKER
when I do that, I don't receive the email anymore.
yes, you're right .. this is to just check ...
before the mail, whether we could see the chars correctly or not ... just to figure out problem from input or transmission to the mail...
got it?
before the mail, whether we could see the chars correctly or not ... just to figure out problem from input or transmission to the mail...
got it?
<?
print '<pre>';
print_r ($_POST);
print '<pre>';
exit;
?
this will stay on your screen to see is what is posted on the page?
print '<pre>';
print_r ($_POST);
print '<pre>';
exit;
?
this will stay on your screen to see is what is posted on the page?
ASKER
ok it's supposed to display the message on the website ? But the flash covers all the page, so I'm wondering where this is supposed to display..
oh.. don't you stop the process on the php process page ...?? any how you have to process the logics in php page as the mail function written page.. you can well stop and see the details...
as i said that could be executed and seen on browser from the php process page.. flash may not be loaded until you redirect or continue from php page..... anyhow just try this...
as i said that could be executed and seen on browser from the php process page.. flash may not be loaded until you redirect or continue from php page..... anyhow just try this...
as a whole I could see the problem could be, due to UTF-8 or mbstring() config.. not sure how to figure out on that unless to see the code/pages..?
i'm moving now.,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to julianopolito for the solution, it works very well now !
Thanks a lot to logudotcom, you offered me a great support !
Thanks a lot to logudotcom, you offered me a great support !
utf-8 for multilingual ...