Post data from flash form to PHP form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • betaboy12
    New Member
    • Jul 2007
    • 1

    Post data from flash form to PHP form

    I'm in the process of creating a flash based widget that send over one field in a form to a PHP file. I need help determing which action scripting I should use for this.

    The user flow is:

    User enters data into one field in a flash file that is embedded in an html page, hits the submit button.

    After hitting the submit button, the user is taken off the current page to another page with their data posted to a form with the results.

    Here's the exact application:

    Create a flash widget that has similar functionality to this:
    http://www.dreamcrowd. com/dream_interpret er.php

    and post data to

    http://www.dreamcrowd. com/dream_interpret er_results.php

    here is my fla file so far without the action scripting.
    http://www.dreamcrowd. com/dream_interpret er.fla
  • xNephilimx
    Recognized Expert New Member
    • Jun 2007
    • 213

    #2
    You should use the loadVariables method.
    Do this, the instance name of the text input that the user use to write the dream should be the name of the variable that you are fetching in the php results page, so if you have your results page get $_POST['dream'], you should name it "dream". Then put that text input inside a movieclip instance named as "form" (for example), then in the code of the button you should write this:

    [CODE=actionscri pt]
    on(release) {
    _root.form.load Variables("drea m_interpreter_r esults.php", "POST");
    }
    [/CODE]

    Then, if you want to get the data from the php to the flash file you should use the form.onData = somefunction; being the "somefuncti on" the function to handle the server response.

    Originally posted by betaboy12
    I'm in the process of creating a flash based widget that send over one field in a form to a PHP file. I need help determing which action scripting I should use for this.

    The user flow is:

    User enters data into one field in a flash file that is embedded in an html page, hits the submit button.

    After hitting the submit button, the user is taken off the current page to another page with their data posted to a form with the results.

    Here's the exact application:

    Create a flash widget that has similar functionality to this:
    http://www.dreamcrowd. com/dream_interpret er.php

    and post data to

    http://www.dreamcrowd. com/dream_interpret er_results.php

    here is my fla file so far without the action scripting.
    http://www.dreamcrowd. com/dream_interpret er.fla

    Comment

    Working...