PHP Code not being Actuated by Flash Actionscript

Discussion in 'PHP' started by deckd18, Feb 14, 2011.

  1. #1
    Here is the Flash Actionscript code that doesn't seem to be sending the data to the PHP file to email out. When the user submits the form on the website, no erros are generated at all. The PHP file is located at the same level in the website direcotry structure. Any help would be great - I've been struggling with this for weeks now..


    function clearField()
    {
    txtField1.text = label1;
    txtField2.text = label2;
    txtField3.text = label3;
    Selection.setFocus("_focus");
    } // End of the function
    label1 = "NAME:";
    label2 = "E-MAIL:";
    label3 = "MESSAGE:";
    var mcContacform = _root.contactform;
    countField = 5;
    clearField();
    var arrayLabel = new Array();
    for (i = 1; i < countField + 1; i++)
    {
    txtField = this["txtField" + i];
    txtField.index = i;
    arrayLabel = this["label" + i];
    txtField.tabIndex = i;
    txtField.onSetFocus = function ()
    {
    if (this.text == arrayLabel[this.index])
    {
    this.text = "";
    } // end if
    };
    txtField.onKillFocus = function ()
    {
    if (this.text == "")
    {
    this.text = arrayLabel[this.index];
    } // end if
    };
    } // end of for
    btnClear.onRollOver = function ()
    {
    this.gotoAndPlay("over");
    };
    btnClear.onRollOut = btnClear.onReleaseOutside = function ()
    {
    this.gotoAndPlay("out");
    };
    btnClear.onRelease = function ()
    {
    clearField();
    };
    btnSubmit.onRollOver = function ()
    {
    this.gotoAndPlay("over");
    };
    btnSubmit.onRollOut = btnSubmit.onReleaseOutside = function ()
    {
    this.gotoAndPlay("out");
    };
    btnSubmit.onRelease = function ()
    {
    if (txtField1.text == label1 || txtField2.text == label2 || txtField3.text == label3)
    {
    gotoAndStop(3);
    }
    else
    {
    _parent.contactform.loadVariables("email.php", "POST");
    gotoAndStop(2);
    } // end else if
    };
    stop ();



    Here is the PHP with my email and site name changed:


    <?php
    //Type the receiever's e-mail address
    $emailAddress = "my@emailaddress";
    //Type your Site Name
    $siteName = "My Site";

    $contact_name = $_POST['name'];
    $contact_email = $_POST['email'];
    $contact_message = $_POST['message'];

    if( $contact_name == true ) {
    $sender = $contact_email;
    $receiver = $emailAddress;
    $client_ip = $_SERVER['REMOTE_ADDR'];

    $email_body = "The Name Of The Sender: $contact_name \nEmail: $sender
    \n\nMessage: \n\n$contact_message \n\nIP ADDRESS: $client_ip \n\n$siteName";

    $emailAutoReply = "Hi $contact_name, \n\nWe have just received your E-Mail. We will get
    in touch in a few days. Thank you! \n\n$siteName ";

    $extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();
    $autoReply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();

    mail( $sender, "Auto Reply: $contact_name", $emailAutoReply, $autoReply );

    if( mail( $receiver, "New E-Mail - $contact_name", $email_body, $extra ) ) {
    echo "success=yes";
    } else {
    echo "success=no";
    }
    }
    ?>
     
    deckd18, Feb 14, 2011 IP
  2. deckd18

    deckd18 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I have been unable to resolve this for weeks now :(
     
    deckd18, Feb 16, 2011 IP