1 Reply Latest reply on Jan 25, 2007 7:48 PM by jagguy99

    flash/php

    jagguy99
      Hi,
      (I didn't know whether to add this to a previous question I asked?).

      I have a flash script which calls a php file. The program works on local machine but not on remote machine. I run the php script on it's own on remote machine and it works fine just to add to my confusion. There programs are just tests of sendload function in flash. I have a larger program which fails so I make an easier 1 to find errors.

      The program sends a value to php script which gets data from a mysql db. It then returns a value from mysql to the flash script.

      I can't debug this as my machine works, the php works on its own on local and remote but the flash/php fails to produce anything on remote.


      php script test10.php

      <?php

      $alname=$_GET['alname2'];
      $result="";
      $sql="";
      $nt="";
      $al="";

      //echo $alname;
      //$files ="files=".$alname."tt44";
      include("dbconnect.php"); //this works for other programs without flash calling

      if (!isset($alname))
      $alname="my1";


      if ($alname=='my1' )
      {
      $sql="select Name from album where id='1' ";
      $result = mysql_query($sql) or die("Invalid query: " . mysql_error());
      $nt=mysql_fetch_array($result) ;
      $al=$nt['Name'];
      }
      else {
      $al="nothing here" ;

      }

      mysql_close($link);

      $files="files=".$al;
      echo $files;

      ?>

      ------------


      flash--
      this.createObject("ComboBox","combo1",this.getNextHighestDepth());
      combo1.addItem("my1");
      combo1.addItem("my2",22);

      combo1._x=100;
      combo1._y=10;

      var txt2:String;
      var txt11:String;
      var nameVars= new LoadVars();

      var send_lv:LoadVars = new LoadVars();

      this.createEmptyMovieClip("mc2",this.getNextHighestDepth());

      var timeINum:Number;
      mc1.onPress = function () {


      txt2=combo1.selectedItem.label;
      send_lv.alname2= txt2;
      // send_lv.sendAndLoad(" http://jagguy.ej.am/flash/test10.php", nameVars, "GET");
      send_lv.sendAndLoad(" http://localhost/flash/test10.php", nameVars, "GET");
      }

      nameVars.onLoad=function(bsuccess:Boolean):Void
      {

      if (bsuccess)
      {
      txt11=nameVars.files;
      loadpics();
      }
      else
      trace("fialed to load");

      };

      function loadpics():Void
      {
      txt33.text=txt11; //undefined

      }