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 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flash to PHP works for me!

    I've got a flash to php form on my site that works 100% of the time... for me. Unfortunately, I keep receiving undefined emails through it. Since it works for me I don't know why it wouldn't work for someone else. Please can someone help?

    The code in the flash file is this:

    send_mc.onRelease = function()
    {

    loadVariablesNum ("form_send.php?sName=" + sName + "&sContact=" + sContact + "&sComments=" + sComments , 0, "POST");

    }

    In the php file it's this:

    <?

    $sName=$_GET["sName"];
    $sContact=$_GET["sContact"];
    $sComments=$_GET["sComments"];

    $to .= "me@mywebsite.com";
    $subject .= "My website contact form";

    //Main body

    $msg .= "Name: $sName\n\n";
    $msg .= "E-mail address: $sContact\n\n";
    $msg .= "Comments/message: $sComments\n\n";

    mail($to, $subject, $msg, "From: USER@mywebsite.com\nReply-To: $sContact\n");
    ?>

    I'm totally stuck and obviously can't test it, because it works!!!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you attach your files including the .fla file so we can test it?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,084
    Thanks
    11
    Thanked 100 Times in 98 Posts
    Are you validating the input in flash before you send it ? you could be sending empty strings, you are also not doing any validation at the PHP end so you send mail regardless of whether any data is sent or not.. thats not entirely bad more of a waste of resources but more importantly your form can be used to send SPAM since you do no validation of emails etc .. see
    this thread for more info
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, I wasn't doing any validation until this morning but now it won't allow you to send it if all the fields are blank! :-)

    Here's a copy of the FLA:
    http://www.albinal.com/flashForm.fla

    I've stripped everything else out to get the filesize down so there's probably some stuff that doesn't work, but I've tested the form and it works for me!

    The standalone form is here:
    http://www.albinal.com/flashForm.swf

    The php page is here:
    http://www.albinal.com/form_send.php

    If that doesn't work, here's a text file of it:
    http://www.albinal.com/form_send.txt

    Many thanks!
    Last edited by Albinal; 07-31-2007 at 01:07 PM. Reason: Add extra link!

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What is in form_send.php now?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean "What is in it?" This link shows you what's in it:
    http://www.albinal.com/form_send.txt

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Thats what I meant. We can't magically see what is inside of php files. In the flash file you have
    Code:
    if (name_txt.text == "" && contact_txt.text == "" && comments_txt.text == "")
    	{
    		form_sent_mc.text_txt.text = "You cannot submit a blank form";
    		form_sent_mc._visible = true;
    		form_sent_mc.enabled = true;
    		
    	}
    You should probably using || (or) instead of &&. If the user just fills in one thing they can get past the if statement.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's what I wanted... It's just something to stop blank forms.


  •  

    Posting Permissions

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