Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flash contact form works with all browsers except Chrome. Help!

    I have scoured the internet looking for an answer to this problem. I could really use some help. My Flash form works perfectly on every other browser but doesnt work on Chrome. When tested on my home computer it works occasionally (maybe one out of 3 times) but from G.A. I can see that a number of people have filled it out and I never received the email. Chrome is the only thing they all have in common.
    My action script code is:

    submit_btn.addEventListener(MouseEvent.CLICK, sendMessage);
    function sendMessage(e:MouseEvent):void{
    var my_vars:URLVariables = new URLVariables();
    my_vars.senderName = name_txt.text;
    my_vars.senderEmail = email_txt.text;
    my_vars.senderMsg = zip_txt.text;
    my_vars.senderNumber = number_txt.text;

    var my_url:URLRequest = new URLRequest("mail.php");
    my_url.method = URLRequestMethod.POST;
    my_url.data = my_vars;

    var my_loader:URLLoader = new URLLoader();
    my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    my_loader.load(my_url);

    then it sends them to a thank you page.

    My php code is:

    <?php
    $to = "myemail@myemail.com";
    $subject = ($_REQUEST['senderName']);
    $message = ($_REQUEST['senderMsg']);
    $number = ($_REQUEST['senderNumber']);
    $message .= "\n\n---------------------------\n";
    $message .= "E-mail Sent From: " . $_REQUEST['senderName'] . " <" . $_REQUEST['senderNumber'] ." <" . $_REQUEST['senderEmail'] . ">\n";
    $headers = "From: " . $_REQUEST['senderName'] . " <" . $_REQUEST['senderEmail'] . ">\n";
    if (mail($to, $subject, $message, $headers))
    {
    echo "answer=ok";
    }
    else
    {
    echo "answer=error";
    }
    ?>

    If anyone has a suggestion on how to make this work with Chrome as well I would appreciate it.

  • #2
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    75
    Thanks
    0
    Thanked 8 Times in 8 Posts
    Just a thought. Try to set the full url to the URL request ("http://www.mysite.com/mail.php") and not just mail.php

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your reply. I will try that. Its very frustrating that this code works perfectly on every other browser but Chrome.

  • #4
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the form work perfectly today with IE and then not again with Chrome. I am very frustrated! I would appreciate so very much help with this problem.

  • #5
    New Coder
    Join Date
    May 2012
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by djpaul1963 View Post
    Just a thought. Try to set the full url to the URL request ("http://www.mysite.com/mail.php") and not just mail.php
    I edited the script and tested it i received the email 3 out of 5 times.
    Which doesnt make sense at all. Either it works or it doesnt. And I believe when a visitor completes the form the first time its most likely not going to send.
    Thank you for your response.

  • #6
    New Coder djpaul1963's Avatar
    Join Date
    Apr 2012
    Location
    Athens GR
    Posts
    75
    Thanks
    0
    Thanked 8 Times in 8 Posts
    Did you tried to add a listener on URLLoader and see what happens? Have a look here http://help.adobe.com/en_US/FlashPla...URLLoader.html

    Another possible cause could be HTTP caches. Try to disable them by using URLRequest.requestHeaders.push( new URLRequestHeader( 'Cache-Control', 'no-cache' ) );


  •  

    Tags for this Thread

    Posting Permissions

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