<?php
include "connect.php";
$nim=$_POST['nim'];
$semester=$_COOKIE['semester'];
$ta = $_COOKIE['ta'];

$cek = mysqli_query($koneksi,"select * from validasi where semester='$semester' AND ta='$ta'");
$hasil=mysqli_num_rows($cek);
if($hasil>0)
{
die("sudah pernah input <a href=loginvalidasi.php>close</a>");
}
echo"<table>";
foreach($_POST['nim'] as $i => $nim){
//$semester = $_POST['semester'][$i];
 mysqli_query($koneksi,"insert into validasi (nim,semester,ta) values ('$nim','$semester','$ta')");
}
echo " Reset Validasi berhasil... <a href=loginvalidasi.php>close</a>"
?>