HTML5表单的创建以及和php交互
2016-09-12 17:33
417 查看
html表单
表单用于获取不同类型的用户输入
常用的表单标签:
<form> 表单
<input> 输入域
<textarea> 文本域
<label> 控制标签
<fieldset> 定义域
<legend> 域的标题
<select> 选择列表
<optgroup> 选项组
<option> 下拉列表中的选项
<button> 按钮
测试代码如下
html与php通讯
html代码:
PHP代码:
<?php
echo "用户名:".$_POST['name']."<br>密码:".$_POST['password'];
表单用于获取不同类型的用户输入
常用的表单标签:
<form> 表单
<input> 输入域
<textarea> 文本域
<label> 控制标签
<fieldset> 定义域
<legend> 域的标题
<select> 选择列表
<optgroup> 选项组
<option> 下拉列表中的选项
<button> 按钮
测试代码如下
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单</title> </head> <body> <form> 用户名:<input type="text"> <br> 密码:<input type="password"> <br> 你喜欢的水果: <br> 苹果<input type="checkbox"> 雪梨<input type="checkbox"> 香蕉<input type="checkbox"> <br> 请选择性别: 男<input type="radio" name="sex">//名字要一样sex 女<input type="radio" name="sex"> <br> 请选择你的网站 <select> <option>http://www.linuxidc.com/Linux/2015-05/117796.htm</option> <option>http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=17</option> <option>https://dev.openwrt.org.cn/wiki/OpenWrt编译教程</option> </select> <br> <textarea cols="30" rows="30">请在次填写个人信息</textarea> </form> </body> </ht c065 ml>
html与php通讯
html代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单与php交互</title> </head> <body> <form action="http://localhost/myservice/newService.php" method="post"> 用户名:<input type="text" name="name"> <br> 密 码:<input type="password" name="password"> <br/> <input type="submit" value="提交"> </form> </body> </html>
PHP代码:
<?php
echo "用户名:".$_POST['name']."<br>密码:".$_POST['password'];
相关文章推荐
- HTML5表单与PHP交互
- html5表单与PHP交互
- HTML5基础15----HTML5表单与PHP交互
- HTML5学习之九表单与PHP交互
- HTML5 HTML5表单与PHP的交互 (stage1-3)
- HTML5 实战PHP之Web页面表单设计
- html5创建联系人表单
- PHP创建文件(夹)以及目录操作
- mysql中的存储过程、触发器、视图是如何创建的,以及PHP中是如何调用的
- php 使用GD库上传图片以及创建缩略图
- android与html5的交互——数据库操作,UI操作,以及html5的localStorage、定位功能
- 全新改进的 HTML5 表单创建
- 在php.ini中设置表单上传文件的大小,以及获取设置的值的方法
- PHP创建文件(夹)以及目录操作
- 使用HTML5和CSS3创建一个时髦的联系表单
- html5 + css3创建炫酷表单
- LAMP环境的搭建以及创建php动态网站
- PHP 创建文件(文件夹)以及目录操作代码
- PHP:Snoopy抓取页面以及模拟提交表单
- 如何创建跨浏览器的HTML5表单