I am using following code to generate multiple textbox on label click, it works correctly and multiple textbox created with different name. I want to take the value of textbox at php side and run insert query for each textbox. But i don't know how to use it in php. Here is my code plz help.
<html>
<head>
<title>
</title>
<script>
var index = 1;
function insertRow(){
var table=document.getElementById("rep1");
var row=table.insertRow(table.rows.length);
var cell1=row.insertCell(0);
var t1=document.createElement("input");
t1.id = "txtName"+index;
t1.name = "txtName"+index;
cell1.appendChild(t1);
index++;
}
</script>
</head>
<body>
<label id="btnAdd" style=" width: 10px;" class="button-add" onclick="insertRow();">add</label>
<table id="rep1">
</table>
</body>
</html>
SQL Schema :
T_no(AI) Text_value
PHP CODE:
<?php
if(isset($_POST["submit"]))
{
$t1=$_POST['name'];// i am confused here how to take value and run query for all
?>