我是新来的PHP环境,只需要从提交中知道。下面给出了我的包含多行的html表(该表由服务器内的PHP ECHO语句生成)。如何发送多个HTML表格值到一个PHP文件
我需要你的帮助将这些值(其实我只需要SAMCODE和SAMQTY领域提交)提交到一个名为SaveSample.php
PHP我曾尝试与正常post[txtCode]
格式和file_get_contents('php://input'))
格式foreach Loop
s让他们进入数组并展开。但不成功。
请帮帮我。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/body.css"/>
<link rel="stylesheet" type="text/css" href="css/table_sampleList.css"/>
<title>Sample Issue</title>
</head>
<body>
<div align="center">
<table width="234" border="1" id="sampleTable" >
<tr bgcolor="#0033FF" style="color:#FFF" height="38" >
<th scope="col" with="55"> SAMCODE</th>
<th scope="col" width="250" > SAMNAME</th>
<th scope="col" width="75" > SAMSIZE</th>
<th scope="col" width="75"> INSTOCK</th>
<th scope="col" width="20px"> SAMQTY</th>
</tr>
<tbody id='sampBody'>
<TR bgcolor='#8CC6FF'><td><input name='txtCode[]' type='text' value='SA0033'size='5' /></td><td>Kool n fresh</td><td>100ml</td><td>100</td><td><input name='txtQty[]' type='text' value='3' maxlength='2' size='3' /></td></tr>
<TR bgcolor='#F0F9FB'><td><input name='txtCode[]' type='text' value='SA0038'size='5' /></td><td>Amoxip</td><td>8s</td>
<td>8</td><td><input name='txtQty[]' type='text' value='5' maxlength='2' size='3' /></td></tr>
<TR bgcolor='#8CC6FF'><td><input name='txtCode[]' type='text' value='SA0976'size='5' /></td><td>Umetac</td><td>10x10</td>
<td>89</td><td><input name='txtQty[]' type='text' value='11' maxlength='2' size='3' /></td></tr>
<TR bgcolor='#F0F9FB'><td><input name='txtCode[]' type='text' value='SA0966'size='5' /></td><td>Umexim 200mg</td><td>10x1</td>
<td>25</td><td><input name='txtQty[]' type='text' value='4' maxlength='2' size='3' /></td></tr>
</tbody>
</table>
</div>
<form name='formSampList' method='post' action='saveSamp.php' onsubmit='' >
<input name='Send' type='submit' value='Submit' />
<input name='Cancel' type='reset' value='Cancel' onclick='' />
</form>
</body>
“正常” 后'[txtCode]'通常会被'$ _ POST [ 'txtCode']' – andrew 2014-10-01 10:21:24