开发者

I can NOT submit the form

开发者 https://www.devze.com 2023-02-15 09:40 出处:网络
Hey guys Im trying to develop an advance consumer website using php and I stuck somewhere while trying to get the data with submitting to another page. All I want to do is to get the checkbox values w

Hey guys Im trying to develop an advance consumer website using php and I stuck somewhere while trying to get the data with submitting to another page. All I want to do is to get the checkbox values which are stored in an array and checked by user. I urgently need your help please here is the code:

$sql2="SELECT * FROM alinanfis WHERE alinanfis.fis_id='".$fis."'" ;
$resultFis=mysql_query($sql2);
if(mysql_num_rows($resultFis)>0)
{
    print "<form method='POST' action='deletionResult.php'>";
    print "<table>";
    print "<tr>";
    print "<th style='background: transparent;'></th>"; 
    print "<th>Fis No</th>";
    print "<th>isim</th>";
    print "<th>soyisim</th>";
    print "<th >Tarih</th>";
    print "<th>Fis Tipi</th>";
    print "<th>Nerede</th>";
    print "<th>Litre</th>";
    print "<th>Tutar</th>";
    print "</tr>";

    while($rowAlinan=mysql_fetch_array($resultFis))
    {
        $sqlFisTipi="SELECT * FROM atype WHERE a_id='".$rowAlinan['a_id']."'" ;

        $resultFisTipi=mysql_query($sqlFisTipi);
        $rowFisTipi=mysql_fetch_array($resultFisTipi);

        $sqlNerede="SELECT * FROM isyeri WHERE i_id='".$rowAlinan['nerde']."'" ;

        $resultNerede=mysql_query($sqlNerede);
        $rowNerede=mysql_fetch_array($resultNerede);

        $开发者_StackOverflow中文版sqlMID="SELECT * FROM musteri WHERE m_id='".$rowAlinan['m_id']."'" ;

        $resultMID1=mysql_query($sqlMID);
        $rowMID1=mysql_fetch_array($resultMID1);

        print "<tr>";

        print "<td><input name='checkBox[]' type='checkbox' value='".$rowAlinan['fis_id']."' />

        php</td>";   

        print "<td>".$rowAlinan['fis_id']."</td>";
        print "<td>".$rowMID1['m_name']."</td>";
        print "<td>".$rowMID1['m_lastName']."</td>";
        print "<td>".$rowAlinan['alinan_tarih']."</td>";
        print "<td>".$rowFisTipi['a_name']."</td>";
        print "<td>".$rowNerede['i_name']."</td>";
        print "<td>".$rowAlinan['litre']."</td>";
        print "<td>".$rowAlinan['tutar']."</td>";
        print "</tr>";
    }

    print '<div class="form_settings">';
    print "<input class='submit' type='submit' name= 'send' value='Send'>";
   /
    print '</div>';
    print "</table>";
    print "</form>";
}//end of if(num_rows>0)

else
    echo '*no such receipt found!!';

mysql_close($con);

Here's the entire code: http://pastebin.com/SBiiSBHu .


You have not included all your code, but could it be that $cols is not set to TRUE in the top of the script?

Edit: I would really like to see the html generated by the php, but here are a few additional remarks:

  1. You definitely need to clean / check your $_GET["fname"] variable before you feed it to a database
  2. You need to specify a doctype

Apart from that, what kind of error do you have exactly?


You may have problems because of the quirks with checkboxes, they need the "checked" to work correctly,

<input type="checkbox" value="true" checked="checked" />

Besides that, use serialize($_POST) and you know what you've got.

regards, //t

0

精彩评论

暂无评论...
验证码 换一张
取 消