Results 1 to 8 of 8

Thread: Flash to PHP to email

  1. #1
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default Flash to PHP to email

    I have a form that I use for submitting data. With HTML everything works perfect, but when I use it with flash for some reason the contents submitted come to my email like this "Name: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#353C53\" LETTERSPACING=\"0\" KERNING=\"0\">John Doe</FONT></P></TEXTFORMAT>
    Email: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#333333\" LETTERSPACING=\"0\" KERNING=\"0\">jdoe@hotmail.com</FONT></P></TEXTFORMAT>
    Message: <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"10\" COLOR=\"#333333\" LETTERSPACING=\"0\" KERNING=\"0\">message content&apos;s</FONT></P></TEXTFORMAT>"

    Does anyone know why the emails are coming to me as HTML code?

    This is the submission code in flash
    Code:
    on(rollOver) {
    	sendbtn.gotoAndPlay("over");
    }
    on(rollOut) {
    	sendbtn.gotoAndPlay("out");
    }
    on(press) {
    	form.loadVariables("email.php", "POST");
    }
    and if needed this is the php code that sends the data
    Code:
    <?php
      $name = $_REQUEST['name'];
      $email = $_REQUEST['email'];
      $message = $_REQUEST['message'];
      
    $subject = "Inquiry/Comment"; 
    
    $message = "
    Name: $name
    Email: $email
    Message: $message
    ";
    
    mail("xxxx@xxxx.com", $subject, $message);
    
    ?>
    I submitted this to flash as I feel it is more of a flash issue than php.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Turn off HTML parsing for the text fields.

    http://livedocs.adobe.com/flex/201/l....html#htmlText

  3. #3
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Medyman View Post
    Turn off HTML parsing for the text fields.

    http://livedocs.adobe.com/flex/201/l....html#htmlText
    Thanks for the link Medyman, I looked over the link but I still can't make sense of it. Is HTML parsing something I need to drop code in to disable? Or is it something you check off in exporting? Or is it something you set in the text parameters for the text fields?

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by nate51 View Post
    Thanks for the link Medyman, I looked over the link but I still can't make sense of it. Is HTML parsing something I need to drop code in to disable? Or is it something you check off in exporting? Or is it something you set in the text parameters for the text fields?
    It's a property of the TextField class. Paste how you're harvesting the variables (the code that gets the values from the text fields) and I'll let you know how to change it.

  5. #5
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    This is the code on the mc which holds the text fields
    Code:
    onClipEvent(data){
    	// show welcome screen
    	_root.content_mc.contact_mc.gotoAndPlay(33);
    }
    Then in the mc the text fields have var names corrosponding with the php page and the "Render Text as HTML" button is off.

    And last but not least this is my submit button
    Code:
    on(press) {
    	// send variables in form movieclip (the textfields)
    	// to email PHP page which will send the mail
    	form.loadVariables("email.php", "POST");
    }
    *submit button is not inside the mc with the text fields.

  6. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    That's all the code related to this? I doubt that. There should be some code that draws the variables out of the textfields and attaches to the "form" object.

  7. #7
    Join Date
    Dec 2007
    Location
    Mississauga
    Posts
    166
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Hate to burst the bubble, but thats all the code it uses.

    I got the original code from http://www.kirupa.com/developer/acti..._php_email.htm

  8. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    No wonder. That's your whole problem.

    Have a look at this tutorial that shows the right way to link PHP & Flash.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •