1 Reply Latest reply on Oct 30, 2010 4:16 PM by kglad

    Send data to MySQL

    huray Level 1

      There an input textfield, name.text. There is a button with the following script,

       

        send.onPress = function () {
                getURL ("name.php", "_blank", "POST");
          }
      The info will be send to MySQL database, name,  when pressing the button.

       

       

      PHP
      ---

       

      <?
      // Receiving the variables.
      $name = $_POST['name'];

       

      // Printing out the variables.
      print "Your name is ". $name . ".";

       

      ?>

       

      I am not able to perform the task, seeking help .

        • 1. Re: Send data to MySQL
          kglad Adobe Community Professional & MVP

          use the loadVars class:

           

          var sendLV:LoadVars=new LoadVars();

          var receiveLV:LoadVars=new LoadVars();

           

          receiveLV.onData=function(src){

          trace(src);

          }

           

          send.onRelease=function(){

          sendLV.name = ???  ;// fix this

          sendLV.sendAndLoad("name.php",receiveLV,"POST");

          }