A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: send form data

  1. #1
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    send form data

    I'm using the send form data function to send email form data to a PHP file that in turn sends response.

    It works however it is loading the actual php page rather than staying on the flash page and recieving the data.

    How do I do it so that it only gets the data and not load a new page?

  2. #2
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Download & study this (simple) example:
    http://necromanthus.com/KoolMoves/GuestBook.html
    cheers

  3. #3
    Senior Member FLASHPULSE's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    1,356
    Go to KoolSource and look at "Mail Form". It's in the script area.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    thanks guys

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Can't get this to work......

    First let me say that I've built email and guestbook systems with another program and very familiar with PHP...

    for testing I've made a simple PHP that just echos back a variable with some text added

    PHP Code:
    <?php //test.php


    echo "&result=".$_GET[me]."_Sentback";

    ?>
    I also used POST for a while as well

    now in KM I've got a dynamic text box wich gets set to something and a button that has

    loadVariables("test.php",0);

    and have tried
    this.loadVariables("test.php","GET")

    and
    _root.loadVariables("test.php","GET")

    so that I can see that the data was both sent and recieved I set a funtion to update the text, here is the AS in the first frame

    result="I've been set"
    me="bret"

    funtion updateText(){
    txt1=result
    }

    setInterval( updateText, 1000 );

    exporting as 6 with compatability on.

    Nothing seems to happen when the button is pressed.

    This all leads back to the way I want to do the email form.. I send the raw data to the PHP where I can use
    PHP Code:
    if (!$name){//empty name?
        
    $response="nameBlank";
        }


    if (!
    eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",$email)){//Valid Email?
        
    $response="BadEmail";
        }

    if (!
    $message){//empty message?
        
    $response="messageBlank";
        }

    if (!
    $response){//All is well if we haven't set a response by this point

        
    $response="success";
        } 
    being able to use eregi to find out if message is OK to really send and send feedback to the flash movie that it was indeed sent, rather than assume it was.

  6. #6
    Senior Member FLASHPULSE's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    1,356
    I'm not good with AS but your button needs an on(release) action.

  7. #7
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    no not that type of button doesn't (Pretty Sure) it is one of the Interface components and shows it as onClick action

  8. #8
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I'm at the end of my rope!

  9. #9
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Can you get the mailform from Koolksource to Work?
    Any programming language is at its best before it is implemented and used.

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Hadn't actually tried to run it. But I am using the same code. But I suppose for fun I should try it on my server.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    dang it that demo works fine.... What the heck!

    I'm using the same syntax.

  12. #12
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Originally posted by blanius
    dang it that demo works fine.... What the heck!

    I'm using the same syntax.
    The mailform is converted from a flash 5 program about two years ago. It worked until a new version of koolmoves came out and then was updated/fixed. I know if the chmods are wrong or you upload the php correctly you will have problems, but you probable now this already. I would have to guess that their is an extra period somewere or something.

    Also for some reason I am unable to download from koolsource???
    Any programming language is at its best before it is implemented and used.

  13. #13
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    RESOLVED

    Ok it turns out it had to do with my variable names and dynamic text elements.

    It's a bit confusing regarding how the variables are sent back and by exporting as V6 with backward compatiblity I just name the text fields as the variable names and it works.

    The thing that made this hard was not being able to get feedback and the idiosyncrosisy of KM that differ from what I've gotten accustom to.

    Thanks eveyone for they feedback here.

  14. #14
    Senior Member FLASHPULSE's Avatar
    Join Date
    Nov 2002
    Location
    USA
    Posts
    1,356
    Originally posted by tmoore935
    Also for some reason I am unable to download from koolsource???
    Just tried it and the download worked fine. Let me know if you are still having issues.

  15. #15
    Relaxing tmoore935's Avatar
    Join Date
    Oct 2001
    Location
    colorado, usa
    Posts
    1,713
    Originally posted by FLASHPULSE
    Just tried it and the download worked fine. Let me know if you are still having issues.
    I can dowmload from work with win 98 but I cannot from home which is xp. Might be service pack 2. I will try again this eve.
    Any programming language is at its best before it is implemented and used.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center