表单的提交获取

表单数据如何提交给php文件

<form action="del.php" method="post">

1.text数据

<input type="text" name="username">

2.password数据

<input type="password" name="pwd">

3.radio单选框

<p>选择科目</p>
<p>
</label>
<input type="radio" name="kemu" value="php">php</label>
</p>
<p>
<label>
<input type="radio" name="kemu" value="java">java
</label>
</p>

4.checkbox多选数据

<p>选则爱好</p>
<p>
</label>
<input type="checkbox" name="love[]" value="wan">wan</label>
</p>
<p>
<label>
<input type="checkbox" name="love[]" value="chi">chi
</label>
</p>
<p>
<label><input type="checkbox" name="love[]" value="he">he</label>
</p>

5.select下拉菜单数据

<p>选择地点</p>
<p>
<select name="city" id=''>
<option>bj</option>
<option>sz</option>
<option>sh</option>
</select>
</p>

6.textarea文本与数据

<textarea name="mess"></textarea>

7.提交按钮

<input type="submit" value="ok">
<input type="reset" value="cancel">

php接收

<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";

?>

猜你喜欢

转载自www.cnblogs.com/qiaozhiming123/p/12769479.html