5 Replies Latest reply on Aug 2, 2008 4:40 PM by kglad

    Flash not sending Vars in POST

    Pinkmischief
      Hi i am trying to do a flash login system , Now at the moment i have 1 textfield and 1 button ( both are simple drawn out ie.. not components from within flash)

      Now as you can see i have appended the username ( textfield to the end of the URL for testing purpose) to see if Dataout.username has any value and if the page can see it, Now it works fine with $_GET but when i use $_POST method in AS it simply will not echo out Dataout.username in once the PHP page is opened. Here is the PHP code.
      The printed out $_POST global just comes out as Array() showing that nothing is inside $_POST, So i am thinking that Flash is not POST,ing the Var Dataout.username to the page.


      <?php
      //Assign username and password to Vars.
      $username = $_POST['username'];
      $password = $_POST['password'];
      //Print out the username
      echo ("Hello ".$username);
      //Display all the vars contained in POST global.
      print_r($_POST);
      ?>

      ActionScript Below contained in Button Layer :
      Thanks
        • 1. Flash not sending Vars in POST
          Pinkmischief Level 1
          Ahh i think i found the answer if im using POST method do i need to export the movie to the webfolder first ?

          Or can i simply test in browser and it should work then ?

          Ok flash confuses me more and more lol i exported the swf and then opened it in my browser all items display but the getURL() function is not working , However when i test in browser from within the development environment it works fine :S

          Thanks Pinky. ;)
          • 2. Re: Flash not sending Vars in POST
            DLMAES Level 1
            You will want to test the send form live from your server... and yes get url from the browser wont work unless test live from your server as well.
            • 3. Flash not sending Vars in POST
              Pinkmischief Level 1
              Hi i tested it from a page on my localhost i setup you can access it here
              http://crms.no-ip.info/flash

              The square block is the button i havent labelled any fields or buttons yet.
              The username field has an instance name of username should i change that to UserInput and the var input field be username ?
              i tried changing the Var field in Flash to username and instance name of UserInput and still i cant retrieve the values from the PHP page?
              When the PHP page loads and opens you will see in the url username="your input" so i know flash is passing it to the page when i manually append it to it :S

              Just a bit more information when i trace(Dataout) i receive username=my input in the trace im just wondering is that the correct format for posting to a page ?

              it opens the PHP in a new page also

              Thanks for your reply :)
              • 4. Re: Flash not sending Vars in POST
                DLMAES Level 1
                I'm not sure why it's not passing the values for those fields, take a look at what I use for a simple form mail in flash:
                • 5. Re: Flash not sending Vars in POST
                  kglad Adobe Community Professional & MVP
                  use different loadvars instances to send and receive.