关于php程序员必知必会的一些html知识

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解码。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值