2 Replies Latest reply on Apr 6, 2007 6:02 PM by kglad

    Can't get my poll to work

    tonylonefight
      http://www.charlotteobserver.com/images/graphics/idolvote/index.html

      this is frame 1

      var lvSampleData:LoadVars = new LoadVars();
      lvSampleData.onLoad = function(bSuccess:Boolean):Void {
      if(bSuccess) {
      /* trace("data loaded"); */
      _global.blakefinal = this.blake;
      _global.chrisfinal = this.chris;
      _global.sanjayafinal = this.sanjaya;
      _global.haleyfinal = this.haley;
      _global.jordinfinal = this.jordin;
      _global.lakishafinal = this.lakisha;
      _global.melindafinal = this.melinda;
      _global.philfinal = this.phil;
      _global.totaltlffinal = this.totaltlf;

      }
      else {
      trace("This is not working, dangit");
      }
      };
      lvSampleData.load("polldata.txt");

      this is in my button:

      _global.blakefinal++;
      _global.idolhonking = "blake="+_global.blakefinal+"&chris="+_global.chrisfinal+"&sanjaya="+_global.sanjayafinal +"&haley="+_global.haleyfinal+"&jordin="+_global.jordinfinal+"&lakisha="+_global.lakishafi nal+"&melinda="+_global.melindafinal+"&phil="+_global.philfinal+"&totaltlf="+_global.total tlffinal;
      trace("idolhonking =" + _global.idolhonking);

      var lvDataSender:LoadVars = new LoadVars();
      lvDataSender.idolhonking = idolhonking.text;
      var lvReceipt:LoadVars = new LoadVars();
      lvReceipt.onload = function(bSuccess:Boolean):Void {
      };
      lvDataSender.sendAndLoad(" http://media.charlotteobserver.com/images/graphics/idolvote/idolvote.php", lvReceipt, POST);
      }

      this is in the php file:
      <?php

      $myFile = "polldata.txt";
      $fh = fopen($myFile, 'w') or die("can't open file");
      $stringData = $_POST['idolhonking'];
      fwrite($fh, $stringData);
      fclose($fh);

      ?>

      I'm such a noob... Any help would be appreciated!!!

      Tony