0
如何創建一個輸入框的數組,其名稱按迭代次序如name = name1,name2 .....就像我想訪問它們下頁使用PHP使用for循環創建多個輸入框並訪問它們將其值存儲在數據庫中
echo"<form action='addprogrammerdetails.php' action='post'>";
echo"<table border='0' class='corner' width='600'>";
echo"<tr>";
echo"<td>";
echo" ";
echo"</td>";
echo"</tr>";
echo"<tr>";
echo"<td colspan='2' bgcolor='#E57614'>";
echo"PROGRAMMER DETAILS";
echo"</td>";
echo"</tr>";
session_start();
$nprog=$_SESSION['nprog'];
for($i=1;$i<=$nprog;$i++)
{
echo"<tr>";
echo"<td>";
echo"<table>";
echo"<tr>";
echo"<td width='300'>";
echo"Programmer Number:";
echo"</td>";
echo"<td>";
echo"<input type='text' name='no[]' value='$i' disabled/>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo"</td>";
echo"</tr>";
}
echo"<tr>";
echo"<td colspan='2' align='center'>";
echo"<input type='submit' value='SUBMIT'/>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo"</form>";
?>