Home  >  Article  >  Backend Development  >  Code for transmitting data from form checkbox to PHP_PHP Tutorial

Code for transmitting data from form checkbox to PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:53:50801browse

The form checkbox is checkbox
1. Application of checkbox

Copy code The code is as follows:


2. Since I am transmitting an array generated in the php loop, the value must also be set as a variable:
for($i=0;$i<10;$i++){
?>


< ;input type="text" name="t2[]" value="Content to be transmitted">

3. Also used when accepting Array:
Copy code The code is as follows:

$ch=$_POST['ch' ];
$t1=$_POST['t1'];
$t2=$_POST['t2']; >        $p_t1=$t1[$a];                                                           



http://www.bkjia.com/PHPjc/318590.html

www.bkjia.com

true
http: //www.bkjia.com/PHPjc/318590.html

TechArticleThe form check box is checkbox 1. The application copy code of checkbox is as follows: inputtype="checkbox"name=" ch"value="2" 2. Since I am transferring the array generated in the php loop, so...
Statement:
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