URLReferer在wap(wml)开发中的应用
来源:互联网 发布:自动化编程 编辑:程序博客网 时间:2024/06/04 18:04
我们在web开发中,经常使用到request集合中的一个元素URLReferer,这个属性是记录当前请求的父请求地址(即记录哪一个地址使得用户点击了链接)。我们通常用于鉴别请求来路、防止盗链等。
而在wml 1.1中,你无法轻松获得,必须使用<go>标签里面的属性 sendreferer
请看摘自wap文档的sendreferer 说明
sendreferer=boolean If this attribute is true, the user agent must specify, for the server's benefit, the URI of the deck containing this task (i.e., the referring deck). This allows a server to perform a form of access control on URIs, based on which decks are linking to them. The URI must be the smallest relative URI possible if it can be relative at all. For example, if sendreferer=true, an HTTP based user agent shall indicate the URI of the current deck in the HTTP "Referer" request header [RFC2616]. method=(post|get) This attribute specifies the HTTP submission method. Currently, the values of get and post are accepted and cause the user agent to perform an HTTP GET or POST respectively.
这是一个完整的使用例子
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE wml PUBLIC "-//wapFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0"/>
</head>
<card id="main" title="ASP.net|论坛">
<p align="left">
欢迎:<a href="usercp.aspx"> 虫虫</a>
<a href="usercpshowpm.aspx">信(1)</a>
<a href="logout.aspx?userkey=e63e600a">退出</a><br/>
<a href="index.aspx">Discuz!NT</a> > <a href="showforum.aspx?forumid=19">S60第一第二版专区</a> > 发表新主题<br/>
<anchor title="back"><prev/>后退</anchor><br/>
用户名:虫虫<br/>
标题:<input name="title"/><br/>
内容:<input name="message"/><br/>
<img src="/tools/VerifyImagePage.aspx?bgcolor=F5FAFE&time=0.812"/><br/>
验证码:<input name="vcode" /><br/>
<anchor>提交
<go href="posttopic.aspx" method="post" sendreferer="true">
<postfield name="title" value="$(title)"/>
<postfield name="message" value="$(message)"/>
<postfield name="forumid" value="19"/>
<postfield name="vcode" value="$(vcode)" />
</go>
</anchor><br/> <br/>
<a href="index.aspx">返回论坛首页</a><br/>
报时:17:41:05<br/>
ET:0.01<br/>
nt!discuz wap beta1 by xyzn.net
</p>
</card>
</wml>
<wml>
<head>
<meta http-equiv="Cache-Control" content="max-age=0"/>
</head>
<card id="main" title="ASP.net|论坛">
<p align="left">
欢迎:<a href="usercp.aspx"> 虫虫</a>
<a href="usercpshowpm.aspx">信(1)</a>
<a href="logout.aspx?userkey=e63e600a">退出</a><br/>
<a href="index.aspx">Discuz!NT</a> > <a href="showforum.aspx?forumid=19">S60第一第二版专区</a> > 发表新主题<br/>
<anchor title="back"><prev/>后退</anchor><br/>
用户名:虫虫<br/>
标题:<input name="title"/><br/>
内容:<input name="message"/><br/>
<img src="/tools/VerifyImagePage.aspx?bgcolor=F5FAFE&time=0.812"/><br/>
验证码:<input name="vcode" /><br/>
<anchor>提交
<go href="posttopic.aspx" method="post" sendreferer="true">
<postfield name="title" value="$(title)"/>
<postfield name="message" value="$(message)"/>
<postfield name="forumid" value="19"/>
<postfield name="vcode" value="$(vcode)" />
</go>
</anchor><br/> <br/>
<a href="index.aspx">返回论坛首页</a><br/>
报时:17:41:05<br/>
ET:0.01<br/>
nt!discuz wap beta1 by xyzn.net
</p>
</card>
</wml>
- URLReferer在wap(wml)开发中的应用
- WAP(wml)开发教程
- WAP(wml)开发教程2--WML学习之概述
- WAP(wml)开发教程2--WML学习之概述
- WAP(wml)开发教程1--概述
- WAP(wml)开发教程1--概述
- WAP(wml)开发faq
- WAP(wml)开发问答
- PHP编程在WAP开发中的应用
- PHP编程在WAP开发中的应用
- WAP(wml)开发教程10--WAP网站服务器配置
- WAP(wml)开发教程10--WAP网站服务器配置
- wap博客开发日记(wml)
- MANA框架在wap游戏开发中的应用
- WAP(wml)开发教程9--WML学习之CGI编程
- WAP(wml)开发教程8--WML学习之页面内部事件
- WAP(wml)开发教程7--WML学习之键盘输入事件
- WAP(wml)开发教程6--WML学习之显示表单
- 沃尔玛十大成功法则
- 全面解析 JDBC
- 汉语托福考题(爆笑)
- ATL的GUI程序设计(2)
- 加载地图数据的几种方法(AE + C#)
- URLReferer在wap(wml)开发中的应用
- 在IE浏览器中如何直接显示word文档
- 我们需要.NET framework3.0的流程设计器吗
- mysql中timestamp类型的应用释疑
- 几种数据库分页查询的实现与比较
- 正则表达式抓取eamil
- js求出字符所占像素及截取字符串
- 你需要认真了解并对待的11条理财真理
- js试衣记录