ذخیره کردن اطلاعات در دیتابیس

shahin69

تازه وارد
سلام

میخوام در صفحه اول مقادیری یکسری اطلاعات رو به کاربر نمایش بدم همراه با چک باکس کنارش

که کاربر هر کدام و تیک زد به صفحه بعد بره مشخصات خودشو وارد کنه مثل اسم و فامیل و در جدول ذخیره بشن

این کد من نوشتم ولی اطلاعات ذخیره نمیکنه؟؟

این صفحه اول که مقادیر و همراه با چک باکس به کاربر نمایش میدم به نام 10.php


کد:
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style>



</style>
</head>
<body>
<?php

 $con=mysql_connect("localhost","root","usbw","azmoon");

      mysql_select_db("azmoon",$con);
      mysql_query('set names utf8');
      ?>
      <form method="POST" action="index5.php">
        <table border="5">
      <?php

      $sql="SELECT * FROM test where 1";
      $t=mysql_query($sql);

      while($row=mysql_fetch_assoc($t))
      {
      ?>

      <tr>
      <td><input type="checkbox" name="idtest[]" value="<?php echo $row['idtest'] ; ?>"></td>
      <td><?php echo $row["day"] ;?></td>
      <td><?php echo $row["time"] ;?></td>
      <td><?php echo $row["date"] ;?></td>
      </tr>


       <?php

      }

      ?>
      <tr>
      <td><input type="submit" name="submit" value="submit" class="del"/></td>
      </tr>
      </table>
</form>



</body>
</html>
و این صفحه دوم که میخوام اون فیلد که در صفحه قبل کاربر تیک انرا زده نیز همراه این اطلاعات ذخیره بشه

که نمیشه ؟ نام این صفحه index5.php


کد:
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style>


</style>
</head>
<body>

<?php
 $con=mysql_connect("localhost","root","usbw","azmoon");

      mysql_select_db("azmoon",$con);
      mysql_query('set names utf8');
      ?>

      <form method="POST" action="<?php $_SERVER["PHP_SELF"];?>"

       <?php  echo '<input type="hidden" name="idtest" value= "'.$_POST['idtest'].'">'; ?>

              <td> <input type="text" name="idb"> </td>

<td><input type="text" name="name"></td>

<td><input type="text" name="tel"></td>

<td><input type="text" name="bime"></td><br><br>
  <td><input type="submit" name="submit" value="submit"/></td>
  </form>
      <?php
     if(isset($_POST['submit']))
     {
    foreach($_POST['idtest'] as $qq)
      {
      $a=$_POST['idb'];
$b=$_POST['name'];
$c=$_POST['tel'];
$d=$_POST['bime'];


$www="insert into it(idb,name,tel,bime,idtest)  VALUES ('".$a."','".$b."','".$c."','".$d."','".$qq."')";
$rr=mysql_query($www);
}
}

mysql_close($con);
}


    ?>

    </body>
</html>
 
بالا