0 Replies Latest reply on Nov 6, 2007 1:10 PM by kenceng

    post multiple

    kenceng
      hi ... all

      how to send multiple data using HTTPService

      if in html and php like this. how to do this in flex ???
      quote:

      <?php
      //$colors = $_POST['colors'];
      $self = $_SERVER['PHP_SELF'];
      $dbh = mysql_connect('localhost', 'root', '') or die(mysql_error());
      mysql_select_db('array') or die(mysql_error());
      ?>
      <FORM METHOD="POST" ACTION="<?=$self?>">
      <P>
      <INPUT TYPE="checkbox" NAME="colors[]" VALUE="red">
      Red<BR>
      <INPUT TYPE="checkbox" NAME="colors[]" VALUE="blue">
      Blue<BR>
      <INPUT TYPE="checkbox" NAME="colors[]" VALUE="green">
      Green<BR>
      <INPUT TYPE="checkbox" NAME="colors[]" VALUE="yellow">
      Yellow </P>
      <INPUT TYPE="checkbox" NAME="colors[]" VALUE="sapi">
      Sapi </P>
      <P>
      <input type="submit" name="button" id="button" value="Submit">
      </P>
      </FORM>
      <?php


      ///////////////////////////////////
      for($c = 0; $c < sizeof($colors); $c++) {
      //$ColorsInsert=implode(",", $_POST['colors']);
      //$ColorsInsert = '*'.implode('*',$_POST['colors']).'*';
      $query = "INSERT INTO colors (warna) VALUES ('".$_POST['colors'][$c]."')";
      $result = mysql_query($query) or die(mysql_error());
      }

      ?>