<input type="hidden" id="" name="name[<?=$name;?>]"/><?=$name;?></input>
....
<?php
include('config.php');
@session_start();
$sessionName = $_SESSION['NAME'];
$date = date('d-m-y');
$loc= $_POST['locationID'];
$name = $_REQUEST['name'];
$status = $_POST['status'];
$class = $_POST['class'];
$section = $_POST['section'];
for( $i = 0; $i < count($loc); $i++ )
{
$sql = "INSERT INTO tbl_attendence (fld_studentname,fld_status,fld_class,fld_section,fld_date,fld_takenby)
VALUES
('$name','$status','$class','$section','$date','$sessionName')
";
//echo $sql; exit;
mysql_query($sql);
}
?>