Skip to main content
Roshan Kolar Ganeshan
Inspiring
April 12, 2010
Answered

Arabic text comes "????" when mailed using Flash contact form. y?

  • April 12, 2010
  • 2 replies
  • 1263 views

Hi There, the guru's of Flash -

I have this pros with flash sending arabic text from a flash contact form using php to my mailid. The arabic part comes ????? while the english part comes really fine. Can any one help me with this? I ran all over the web for this but it just dint work out fine..

here goes my flash code -

// Loading Variables and Settings
stop();
error_clip._alpha = 0;
System.useCodepage = true;
send_btn.onRelease = function() {
     my_vars = new LoadVars();
     my_vars.namex = name_txt.text;
     my_vars.email = email_txt.text;
     my_vars.msg = msg_txt.text;

     // If text fields are not blank the message will be sent
     if (my_vars.namex != "" and my_vars.email != "" and my_vars.msg != "") {
          my_vars.sendAndLoad("send_mail.php",my_vars,"POST");
          gotoAndStop(2);
          // Else if text fields are blank a warning message will appear
     } else {
          error_clip._alpha = 100;
     }
     // After the message is sent the user will be redirected to frame 3
     my_vars.onLoad = function() {
          gotoAndStop(3);
     };
};
// If you click on another field "All Fields Required" will dissapear
name_txt.onSetFocus = email_txt.onSetFocus=msg_txt.onSetFocus=function () {
     if (error_clip._alpha != 0) {
          error_clip._alpha = 0;
     }
};

clr_btn.onPress = function() {

     msg_txt.text = "";

};

And here is the PHP part -

<?php
// Loading Variables
$name = $_REQUEST["namex"] . "\n\n";
$email = $_REQUEST["email"];
$message = $_REQUEST["msg"] . "\n\n";
// The \n character means New Line

// Mixing all variables, including IP
$full_message ="From ".$name.",  ".$email."    ".$message;

// Remove the backslashes that appears when entering characters like " or '
//$name = stripslashes($name);
//$email = stripslashes($email);
//$message = stripslashes($message);

     $subject = "Tell Me!!";
     $from = $name;
     $headers  = "From: $from\r\n";
     $headers .= "CC: dummyid@dummyclient.com\r\n";

     


     
      $headers .= "Content-Type: text/html; charset=utf-8";
     
      $body = $full_message;

     /*$body = "<html><head><title>Untitled Document</title><meta http-equiv=Content-Type content='text/html; charset=iso-8859-1'></head><table width=440 border=0 align=center cellpadding=6 cellspacing=1 bgcolor=#000000>  <tr bgcolor=#000000><td colspan=2 nowrap><font color=#FFFFFF size=2 face='MS Sans Serif'><B>ONLINE FEEDBACK</B></font></td>  </tr>";
     $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>Name<font size=1>:</font></font></td>    <td width='68%'><font size=2 face='MS Sans Serif'><B>" . $name . "</B></font></td></tr>";
     $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>E-mail/Website</font></td><td><font size=2 face='MS Sans Serif'><B>" . $email . "</B></font></td></tr>";
     $body .= "<tr bgcolor=#FFFFFF><td width=32% nowrap><font size=2 face='MS Sans Serif'>Message</font></td><td><font size=2 face='MS Sans Serif'><B>" . $message . "</B></font></td></tr>";
     $body .= "<tr><td nowrap valign=top> </td><td> </td></tr></table></body></html>";*/
     

     
     // Sending the mail
// Note: Don't forget to change "your@email.com" to receive the mail from contact form
     mail("themailichecked@theclient.com", $subject, $body, $headers);


?>

there were many probs similar to this online and i couldnt find the right solution. Can you please help me out? The form works completely file for english text. No probs in the code, but arabic part is very tricky.

Thanks a lot in advance.

This topic has been closed for replies.
Correct answer cscrudder

In the text fields, have you embeded the arabic language? 

2 replies

Inspiring
April 12, 2010

If the text is displaying properly while being typed in Flash then the problem is most likely with the PHP (or some other bit on the server end) of the process.

My guess is that somewhere along the line there is a server that doesn't know that it is supposed to be getting UTF-8 content. I don't know anything about PHP, but I see that you have utf-8 in there. I also notice that in html header bit there you have charset=iso-8859-1

Finally are you sure you e-mail reader is able to display arabic? Just got to ask...

cscrudderCorrect answer
Inspiring
April 12, 2010

In the text fields, have you embeded the arabic language?