post接收不到成绩,按纵行显示?

WBOY
Release: 2016-06-06 20:23:19
Original
1200 people have browsed it

<code>
<title>成绩</title>

<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>


<?php if(isset($_POST['postmethod']))
{
     $CJ=$_POST['C'];
    
     echo"接收的成绩:<br/>";
     
   
} else {
    echo "Nothing";
}
?>
</code>
Copy after login
Copy after login

回复内容:

<code>
<title>成绩</title>

<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>


<?php if(isset($_POST['postmethod']))
{
     $CJ=$_POST['C'];
    
     echo"接收的成绩:<br/>";
     
   
} else {
    echo "Nothing";
}
?>
</code>
Copy after login
Copy after login

echo '

';<br>print_r($CJ);
                            
            <p class="answer fmt" data-id="1020000004091116">
                                    
</p><pre class="brush:php;toolbar:false"><code>for($i=0; $i<count echo .></count></code>
Copy after login

另外,建议name值改为

<code>C[]['xm'],C[]['xh']...</code>
Copy after login

起码知道value所属key

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template