Results 1 to 3 of 3

Thread: how does php "post" work in flash?

  1. #1

    how does php "post" work in flash?

    when i use post for a html form, it will submit all the data collected by that form as the POST array...but how does "POST" work for flash? i mean which datas will it submit..i dont actually understand this so it will be better if you can point me to some resources where i can find more information about flash+php+flat-file system.
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  2. #2
    Submitting data through POST or GET is just a different way of performing an HTTP request. More specifically, in GET requests the variables are part of the requested URI, and in POST requests they're sent in a separate HTTP header. So Flash sends POST data in the same way your browser does; by adding a separate HTTP POST header.

    The way in which it sends POST data kinda depends on what you're using. If you're using the LoadVars object, then it's pretty simple really: any variable/value pair that you set in the LoadVars object will be sent as POST data. So for example:
    Code:
    var lv:LoadVars = new LoadVars();
    lv.myVariable = "myValue";
    lv.send("http://www.yoursite.com/script.php", "_blank", "POST");
    PHP Code:
    <?php 
    // http://www.yoursite.com/script.php
    var_dump($_POST);
    ?>
    You will find that the myVariable/myValue pair is registered in the $_POST array.

    Also, keep in mind that (last time I checked) the Flash IDE cannot and will not send POST data. You will need to test your SWF from inside a browser window to properly test POST capabilities.
    Wait, what?

  3. #3
    thank you for your response...all is cleared up now!!
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012