0
這裏是index.php文件如何通過表單爲單個名稱發送多個值?
<!doctype html>
<html>
<head>
</head>
<body>
<form action="process.php" method="post">
<input type="checkbox" name="language" value="C" />:C
<input type="checkbox" name="language" value="C++"/>:C++
<input type="checkbox" name="language" value="java"/>:JAVA
<input type="checkbox" name="language" value="python"/>:PYTHON
<input type="checkbox" name="language" value="none"/>:None
<br/>
<input type="submit" value="submit" />
</form>
</body>
</html>
這裏是我的process.php
<!doctype html>
<html>
<head></head>
<body>
<pre>
<?php
print_r($_POST);
?>
</pre>
</body>
</html>
這兩個文件都在同一個文件夾。在這些php頁面中,我試圖通過index.php表單顯示數據的內容。
但它只顯示最後點擊的複選框。例如,如果我已經檢查過C++和JAVA,那麼它將只顯示JAVA,所有前面的內容都將被啓動。由於複選框是爲多個檢查而做的,爲什麼不把它顯示爲數組(值)?
我想知道如何獲取單個名稱的多個值?
可能重複(http://stackoverflow.com/questions/1010941/html-input-arrays) –