<!DOCTYPE html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>多表单提交</title></head><body> <form action="" method="post"> <table width="500"> <tr> <th>标题</th> <th>作者</th> <th>添加时间</th> </tr> <tr> <td><input type="text" name='title'/></td> <td><input type="text" name='user' /></td> <td><input type="text" name='addtime'/></td> </tr> <tr> <td><input type="text" name='title' /></td> <td><input type="text" name='user'/></td> <td><input type="text" name='addtime'/></td> </tr> <tr> <td colspan="3" align="center"> <input type="submit" value="提交" /> <input type="reset" value="重置" /> </td> </tr> </table> </form> <?php $title=$_POST['title']; $user=$_POST['user']; $addtime=time(); echo '<hr>'; echo $title; echo '<br>'.$user; echo '<br>'.$addtime; ?></body></html>
$st=array( array('小李','19','语文'), array('王强','20','数学'), array('张王磊','29','演员'), array('胡科林','27','钢琴老师') );
<!DOCTYPE html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>多表单提交</title></head><body> <form action="" method="post"> <table width="500"> <tr> <th>标题</th> <th>作者</th> <th>说明</th> </tr> <tr> <td><input type="text" name='title[]'/></td> <td><input type="text" name='user[]' /></td> <td><input type="text" name='note[]'/></td> </tr> <tr> <td><input type="text" name='title[]' /></td> <td><input type="text" name='user[]'/></td> <td><input type="text" name='note[]'/></td> </tr> <tr> <td colspan="3" align="center"> <input type="submit" value="提交" /> <input type="reset" value="重置" /> </td> </tr> </table> </form> <?php $title=$_POST['title']; $user=$_POST['user']; $note=$_POST['note']; echo '<hr>'; echo '<pre class="brush:php;toolbar:false">'; print_r($title); echo '<br>'.print_r($user); echo '<br>'.print_r($note); echo ''; ?>