6 Replies Latest reply on Aug 12, 2009 9:23 AM by kglad

    FLASH --> PHP server side script

    Ron Colmen Level 2

      It's a SUBMIT form - There are 5 checkboxes which are used to select 5 types of images. How to write my AS code to send the selected images to the PHP and then back to abc@mail.com ?

       

      The current AS code:

      var senderLoad:LoadVars = new LoadVars();
      var receiveLoad:LoadVars = new LoadVars();

       

      sender.onRelease = function () {
      senderLoad.thename = thename.text;
      senderLoad.thecompany = thecompany.text;
      senderLoad.theaddress = theaddress.text;

      senderLoad.sendAndLoad("web-web/send.php",receiveLoad);
      }

      receiveLoad.onLoad = function () {
      if(this.sentOk) {
        _root.gotoAndStop("success");
      }
      else {
        _root.gotoAndStop("failed");
      }
      }

       

       

      The current PHP code:

       

      <?PHP
      $to = "abc@mail.com";

      $subject = "subj.sbuj";
      $headers = "From:" .$email."\r\n";
      $headers .= "Bcc: $email\r\n";
      $message = "Name: " . $thename;
      $message .= "\n\nCompany or Club Name: " . $thecompany;
      $message .= "\n\nAddress: " . $theaddress;

      $sentOk = mail("$to",$subject,$message,$headers);


      echo "sentOk=" . $sentOk;