A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Confused about POST, GET, loadvars.send ...

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Confused about POST, GET, loadvars.send ...

    I'm trying to send a value from flash to PHP and then write it to MySQL db. The AS code I've got is:

    submittedData = new LoadVars();
    submittedData.inputData = inputData.text; //suppose I've written "foobar" in the input text box

    //in the button.onPress function there is ...
    submittedData.send("myphpscripturl", "POST");

    When I click on the button, the value does get sent to the php script but it seems to be via the GET method as it appears at the end of the url in the browser address bar like this:

    www.mydomain.com/myscript.php?inputData=foobar

    and I can grab it with PHP using $_GET and write it to a text file.

    What am I doing wrong?

    Many thanks,

    - guy

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    According to the documentation, the second value in send() is the target, and the third value is GET or POST:

    http://help.adobe.com/en_US/AS2LCR/F...=00001174.html

  3. #3
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    Correct, you're missing the correct parameters:

    submittedData.send("myphpscripturl", "_self", "POST");
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

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