<html>
<head><title>成绩</title></head>
<body>
<form method="post" action="4.2.php">
小明:<input type="text" name="C[]"><br/>
小红:<input type="text" name="C[]"><br/>
小白:<input type="text" name="C[]"><br/>
小李:<input type="text" name="C[]"><br/>
小兰:<input type="text" name="C[]"><br/>
<input type="submit" name="postmethod" value="提交">
</form>
</body>
</html>
<?php
if(isset($_POST['postmethod']))
{
$CJ=$_POST['C'];
echo"接收的成绩:<br/>";
} else {
echo "Nothing";
}
?>
echo '<pre>';
print_r($CJ);
for($i=0; $i<count($CJ); $i++){
echo $CJ[$i] . "/n";
}
另外,建议name值改为
C[]['xm'],C[]['xh']...
起码知道value所属key