<?php
mysql_connect("localhost", "root", "");
mysql_select_db("mansapas");
error_reporting(0);
 
$nis = $_POST['nis'];
$jumspp = $_POST['jumspp'];
$tg=$_POST['tgl'];
 
for($i = 1; $i <= $jumspp; $i++)
{
   $nama_bulan = $_POST['nama_bulan'.$i];
   if (!empty($nama_bulan))
   {
     $query = "INSERT INTO trx_spp VALUES('$nis', '$nama_bulan','$tg')";
     mysql_query($query);	  
   }
}
 
echo "<script type='text/javascript'> document.location = 'proses_cari.php'; </script>";
?>
