Chào mọi người hiện tại em đang làm nl về 1 web đặt phòng và em bị gối ở đây ạ .em có sử dụng 2 mảng để chứa mã phòng và số lượng phòng khi người dùng đặt số lượng bao nhiu phòng thì cái from sẽ hiện ra bấy nhiu thẻ input gồm họ tên và cmnd để người dùng nhập vào vậy thì làm sao em có thể lấy ra từng cái giá trị trong thẻ input để insert ạ ? cảm ởn mọi người
$con= new mysqli("localhost","root","","nlcs");
$con->set_charset("utf8");
$obj = json_decode($_GET["ma"], false);
$vtr = json_decode($_GET["vtr"], false);
$usn = $_SESSION['usn'] ;
$sop =$_GET['sop'];
$tonggia=$_GET['tonggia'];
$ngden=$_GET['ngayden'];
$ngdi=$_GET['ngaydi'];
$num=count($obj);
$book="insert into book (b_Ngaynhan,b_ngaytra,b_sophong,b_gia,tk_Ma,)
values ('$ngden','$ngadi',$sop,$tonggia,'$usn')";
<div id="id01" class="modal">
<center>
<form class="modal-content" action='hoantatdp.php' name="datphong" method="POST" enctype="multipart/form-data">
<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<h5>Vui lòng điền đầy đủ thông tin đặt phòng</h5>
<div class="container1">
<div id='nd-ndi'>
<p>Ngày nhận: <?php echo $ngden ?> </a></p>
<p>Ngày trả: <?php echo $ngdi ?> </a></p>
</div>
<div class ='book1'>
<?php
for($i = 0 ; $i < count($obj);$i++){
$sql="SELECT lp_Ten , lp_Ma FROM loaiphong WHERE lp_Ma = ".$obj[$i]."";
$result = $con->query($sql);
while($row = $result->fetch_assoc()) {
for($j = 0 ; $j < $vtr[$i] ; $j++ ){
echo "<table>
<tr>
<th colspan='2'><label for='uname' name='".$row['lp_Ten']."'><a>".$row['lp_Ten']."</a></label></th>
</tr>
<tr>
<th><b>Họ tên: </b></th>
<td><input type='text' placeholder='Họ tên' name='".$row['lp_Ma']."$j' required></td>
</tr>
<tr>
<th><b>Số CMND: </b></th>
<td><input type='text' placeholder='Số chứng minh nhân dân' name='".$row['lp_Ma']."$j' 'required></td>
</tr>
</table>
";
}
}
}
?></div>
<table>
<tr>
<td colspan="2"><center> <button class='datphong' type="submit">Hoàn tất quá trình đặt phòng</button></center></td>
</tr>
</table>
</form>
</center>
</div>";