3 Replies Latest reply on Feb 25, 2008 4:02 AM by exPluda?

    Line breaks deleted when Flash variables sent to PHP

    finalcutexpress Level 1
      Hi all -

      I have a designed a Flash based interface to send email via PHP.

      I capture the variables in Flash using:

      var my_lv:LoadVars=new LoadVars();
      my_lv.name=name_txt.text;
      my_lv.message=message_txt.text;
      // ...
      // ...
      my_lv.send("mail.php","POST");

      My PHP reads:

      <?php

      $headers = "From: " . $_POST["name"];
      $headers .= "<" . $_POST["from"] . ">\r\n";
      $headers .= "Reply-To: " . $_POST["from"] . "\r\n";
      $headers .= "Return-Path: " . $_POST["from"];

      $to = $_POST['to'];
      $message=stripslashes($_POST['message']);
      //NOTE: I tried $message without stripslashes - same results
      $subject=stripslashes($_POST['subject']);
      mail($to, $subject, $message, $headers);

      ?>

      When the message is received all line breaks using RETURN/ENTER in Flash message .swf are deleted making the message one long line when viewed by the recipient. Is there something I need to write into my actionscript/php to allow the message to recognize these hard line breaks and display properly in the recipient's email client? I'm guessing (hoping!) it's an easy fix. BTW, the messages do display properly in 'some' clients and not others. I need some fix that will correct this across the board.

      Thanks in advance -