日期:2011-07-26  浏览次数:20390 次

1.form表单,
<form name="form1" id="form1" method="GET/POST" action = "提交url"  target=“_blank,_parent,_self,_top” enctype="multipart/form-data" />
<input type=“text” name=“” id="" value="" class="" />
 <input type=“password” name=“” id="" value="" class="" />
<input type=“file” name=“” id="" value="" class="" accept=“” />上传文件  一定要用post方法上传   还要是enctype="multipart/form-data"   
<input type="file" accept="application/msword" ><br><br>accept属性列表<br>
1.accept="application/msexcel"
2.accept="application/msword"
3.accept="application/pdf"
4.accept="application/poscript"
5.accept="application/rtf"
6.accept="application/x-zip-compressed"
7.accept="audio/basic"
8.accept="audio/x-aiff"
9.accept="audio/x-mpeg"
10.accept="audio/x-pn/realaudio"
11.accept="audio/x-waw"
12.accept="image/gif"
13.accept="image/jpeg"
14.accept="image/tiff"
15.accept="image/x-ms-bmp"
16.accept="image/x-photo-cd"
17.accept="image/x-png"
18.accept="image/x-portablebitmap"
19.accept="image/x-portable-greymap"
20.accept="image/x-portable-pixmap"
21.accept="image/x-rgb"
22.accept="text/html"
23.accept="text/plain"
24.accept="video/quicktime"
25.accept="video/x-mpeg2"
26.accept="video/x-msvideo"
在这里如果想支持多种类型的话,比如金山的office和microsoft的office的不同扩展名,这样的话可以在accept里面放置多个属性就可以了:
<form> <input type="file" name="pic" id="pic" accept="image/gif, image/jpeg" /></form>
如果不限制图像的格式,可以写为:accept="image/*"。同样是可以的
php处理页面的获取$_FILES['NAME']['name']
<input type=“image” name=“” id="" class=""  src="路径" />具备按钮功能哦
<input type=“radio” name=“” id="" value="" class="" checked="checked" /> 一组用相同的name
<input type=”checkbox“ name=“name[]” id="" value="" class=""  checked="checked" />  dom对象.checked  = true or false
<input type=“submit” name=“” id="" value="" class="" />提交
<input type=“reset” name=“” id="" value="" class="" />重置表单
<input type=“button” name=“” id="" value="" class="" />按钮
<input type=“hidden” name=“” id="" value="" class="" />隐藏域
<select name="" id=""  class="" >
<option value=""  selected='selected'>value1</option>
</select>
<select name="" id="" size=“” class="" multiple >
//菜单格式,全部列出来
可以有多个选中
<option value="">value1</option>
</select>
<textarea name="" id="" rows="" cols="" value="" >xxxxx</textarea>
</form>
id唯一
URL编码。中文,特殊符号,等。
url的参数如果有特殊符号,?/等,可以urlencode编码。。。。获取后用urldecode解码。

本文链接http://www.cxybl.com/html/wlbc/Php/20130616/38659.html