Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2010
    Posts
    124
    Thanks
    6
    Thanked 0 Times in 0 Posts

    post methos problem

    $result38 = mysql_query("SELECT * FROM Sc_Itemnot_Include Where Sc_No='".$scpass."' AND Seq_No='".$seq."' AND Item_Code > '0' " )
    or die(mysql_error());
    //echo "SELECT * FROM PC_Item Where SC_No='$scpass' AND Seq_No='$seq'";
    $count=0;
    while($row38 = mysql_fetch_array( $result38 ))
    {

    $itemcode=$row38['Item_Code'];

    $count++;

    // echo $itemcode;

    // $result391 = mysql_query("SELECT * FROM Sc_Itemnot_Include Where Sc_No='".$scpass."' AND Seq_No='".$seq."' AND Item_Code > '0' " )
    // or die(mysql_error());
    //echo
    //echo "SELECT * FROM PC_Item Where SC_No='$scpass' AND Seq_No='$seq'";
    // $row391 = mysql_fetch_array( $result391 );

    // $num_rows2 = mysql_num_rows($result39);

    $type=$row38['Type'];
    //echo $type;
    $itemcode1=$row38['Item_Code'];
    // echo $type;
    // echo "-";
    //echo $itemcode1;
    if($type == 'F')
    {
    $result40 = mysql_query("SELECT * FROM ST_Item_Fixed Where Item_Code='".addslashes($itemcode1)."' " )
    or die(mysql_error());
    //echo "SELECT * FROM PC_Item Where SC_No='$scpass' AND Seq_No='$seq'";
    $row40 = mysql_fetch_array( $result40 );

    $priceus=$row40['Price_US'];

    //echo $priceus;
    $priceusssttl=$priceusssttl+$priceus;
    // echo $priceusssttl;
    //$priceussstt1=$priceussstt1+$priceus;
    if($priceus == "")
    {

    $priceus=0;

    }

    }

    if($type == 'B')
    {
    $result41 = mysql_query("SELECT * FROM ST_Item_Bulk Where Item_Code='".addslashes($itemcode1)."' " )
    or die(mysql_error());
    //echo "SELECT * FROM ST_Item_Bulk Where Item_Code='".addslashes($itemcode1)."' ";
    //echo "SELECT * FROM PC_Item Where SC_No='$scpass' AND Seq_No='$seq'";
    $row41 = mysql_fetch_array( $result41 );

    $priceus=$row41['Price_US'];
    // echo $priceus;
    $priceussstt2=$priceussstt2+$priceus;
    //echo $priceussstt2;
    if($priceus == "")
    {

    $priceus=0;

    }
    // echo $priceussstt2;

    }
    $priceussstt3=$priceusssttl+$priceussstt2;

    $TTlimp=$pcprice1+$priceussstt3+$Regit_Single;

    $TTlsummm=$TTlimp+$localsum;

    $impwpecen=($TTlimp*100)/$TTlsummm;

    $localwpecen=($localsum*100)/$TTlsummm;
    ?>
    <tr bgcolor="#CC99FF">
    <td width="147" bgcolor="#CC99FF"><strong>INI</strong></td>
    <td width="130"><?php print $itemcode ?></td>
    <td bgcolor="#CC99FF"><input type="text" onkeyup="add(getElementsByName('putts[]'))&impsumm()&localpp()&imppp()&TTLpsum()" name="putts[]" value="<?php print $priceus ?>"/>


    </label>
    </span></td>
    <td>&nbsp;</td>
    </tr>

    <?php
    }

    ?>

    hear i need to name="putts[]" text box values pass using POST method ..
    how do i pass this values ,.. plzz help me to solve this

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I don't quite understand the problem here. The code you have doesn't show the use of the putts, so I assume your question is how to deal with it after?
    When you use [] on an input name, it now becomes an array. So instead of pulling scalar values from $_POST['putts'], you instead pull an array. You can iterate this array using a loop, or do whatever you need to do. If you leave it with just [], it will numerically increment them starting from 0, so the first submitted text field would be $_POST['putts'][0], and all the way up to n - 1, where n is the number of fields you have used.

    Also, in the future please wrap all code in [php][/php] or [code][/code] tags to make them readable.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •