2 Replies Latest reply on Aug 12, 2007 5:06 AM by Shintaja

    LoadVars

    Shintaja
      Now i got this code

      function sends() {
      // variables
      var script:String = "test.php";
      var method:String = "POST";
      var sender = new LoadVars();
      var loader = new LoadVars();

      // assign data
      sender.user = username;
      sender.pass = password;

      loader.datas;


      // send data to the server and catch return
      sender.sendAndLoad(script, loader, method);
      {
      if (loader.datas =="success")
      {
      logname=sender.user;
      gotoandplay(3);
      }
      else
      {
      gotoandstop(2);
      }
      };
      }

      So how do i load a certain variable that has a certain data from php to flash.
      And i got this code on my php file:


      <?

      $tunnus=$_POST["user"];
      $salasana=$_POST["pass"];

      mysql_pconnect("****", "****", "*****") or die('<p>Ei pystynyt yhdistämään mysql-tietokantaan.</p>');
      mysql_select_db('*****') or die('no database');


      $query ="SELECT * FROM test WHERE tunnus ='$tunnus' AND passu = '$salasana'";
      $result = mysql_query( $query ) or die ('didnt query');

      //Katsoo jos on täysin sama nimi ja passu...
      $num = mysql_num_rows( $result );
      if ($num == 1)
      {

      }
      else{

      }
      ?>