在单个URI中指定锚点和cgi参数 [英] specifying anchors and cgi parameters in a single URI

查看:80
本文介绍了在单个URI中指定锚点和cgi参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




需要一些关于URI的建议


在动态页面(perl驱动)中,我们列出了一些项目

分层树结构。在该页面内是一个表格,允许您搜索包含各种字符串的项目(试图获得

用户*记住* CTRL + F证明没有结果)。然后在页面顶部显示结果

,其中包含指向相对锚点的链接

引用(< a href ="#foo">)。单击时,这些将带您到分层树中的该项目。


问题是页面的URI本身包含CGI参数

(例如 http:// www .foo.com / script.cgi?p = 1& r = 2 )并将这些内容带到包含锚点的URI上(例如
http://www.foo.com/script.cgi? p = 1& r = 2#foo )。


这些包含参数和锚点的URI在IE中工作(6及以下)

但是不是在Moziall,Firefox,Konqueror或Opera中。关于我能做什么的想法可以实现跨浏览器的相同功能吗?


问候

Crimperman

Hi,

need some advice on URIs

In a dynamic page (perl driven) we list a number of items presented in
an hierarchical tree structure. Within that page is a form which allows
you to search for items containing various strings (trying to get the
users to *remember* CTRL+F was proving fruitless). The results are then
presented at the top of the page with links to the relative anchor
references (<a href="#foo">) . When clicked these would take you to
that item in the hierarchical tree.

The problem is that the URI of the page itself contains CGI parameters
( e.g. http://www.foo.com/script.cgi?p=1&r=2 ) and these are carried
over to the URIs containing the anchors ( e.g.
http://www.foo.com/script.cgi?p=1&r=2#foo ).

These URIs containing parameters and anchors work in IE (6 and below)
but not in Moziall,Firefox, Konqueror or Opera. Any ideas on what I can
do to enable the same functionality cross-browser?

regards
Crimperman

推荐答案

Crimperman写道:
Crimperman wrote:


需要一些关于URI的建议
在动态页面(perl驱动)中,我们列出了以分层树结构呈现的许多项目。在该页面内是一个表单,允许您搜索包含各种字符串的项目(试图让
用户*记住* CTRL + F证明没有结果)。然后将结果显示在页面顶部,其中包含指向相对锚的引用(< a href ="#foo">)。单击时,这些将带您进入分层树中的该项。

问题是页面的URI本身包含CGI参数
(例如 http://www.foo.com/script.cgi?p=1& ; r = 2 )并将这些内容传送到包含锚点的URI(例如
http://www.foo.com/script.cgi?p=1&r=2#foo )。<这些包含参数和锚点的URI在IE(6及以下版本)中工作,但不适用于Moziall,Firefox,Konqueror或Opera。关于我可以做什么来实现跨浏览器启用相同功能的任何想法?

Crimperman
Hi,

need some advice on URIs

In a dynamic page (perl driven) we list a number of items presented in
an hierarchical tree structure. Within that page is a form which allows
you to search for items containing various strings (trying to get the
users to *remember* CTRL+F was proving fruitless). The results are then
presented at the top of the page with links to the relative anchor
references (<a href="#foo">) . When clicked these would take you to
that item in the hierarchical tree.

The problem is that the URI of the page itself contains CGI parameters
( e.g. http://www.foo.com/script.cgi?p=1&r=2 ) and these are carried
over to the URIs containing the anchors ( e.g.
http://www.foo.com/script.cgi?p=1&r=2#foo ).

These URIs containing parameters and anchors work in IE (6 and below)
but not in Moziall,Firefox, Konqueror or Opera. Any ideas on what I can
do to enable the same functionality cross-browser?

regards
Crimperman



一些URI必须对字符进行编码,其中一个是#。

使用"%23"为了它。谷歌URI编码更多细节。


如果你还不知道这个,

你_may_也写了你的剧本

破解者可以轻松进入。


Google forPerl detainting"和Perl CGI安全性和Perl CGI安全性。这样。

一定要使用cgi.pm而不是你自己的cgi界面 - 它

内置了许多你可能没想过的安全检查
左右。

-

mbstevens
http://www.mbstevens.com/


A number of URI characters must be encoded, one of which is "#".
Use "%23" for it. Google "URI encoding" for more detail.

If you don''t know about this already,
you _may_ also have written your script in a way that
crackers can get into easily.

Google for "Perl detainting" and "Perl CGI security" and such.
Be sure to use cgi.pm instead of your own cgi interface -- it
has many security checks built in that you may not have thought
about.
--
mbstevens
http://www.mbstevens.com/


mbstevens写道:
mbstevens wrote:
必须编码许多URI字符,其中一个是#。
使用%23和%23。为了它。谷歌URI编码了解更多细节。


这会产生两个问题。 href为%23foo。 (并且*仅*那个)不是由浏览器作为本地锚点传递的
- 而是作为
http://www.foo.com/#foo

在锚点链接中提供整个URI(
http:// www。 foo.com/script.cgi?p=1&r=2%23foo )最终以浏览器

传递2%23foo作为最后一个参数的值。

编码#使用#只会产生与使用普通

#字符相同的结果。

如果你还不知道这个,<你_may_也写了你的脚本,方式可以轻松进入。
A number of URI characters must be encoded, one of which is "#".
Use "%23" for it. Google "URI encoding" for more detail.
This creates two problems. An href of "%23foo" (and *only* that) is not
passed by the browser as a local anchor - it is instead passed as
http://www.foo.com/#foo .
Giving the entire URI in the link to the anchor (
http://www.foo.com/script.cgi?p=1&r=2%23foo ) ends up with the browser
passing 2%23foo as the value for the last parameter.
Encoding the # using # just gives the same result as using a plain
# character.
If you don''t know about this already,
you _may_ also have written your script in a way that
crackers can get into easily.




我知道它(其他相关字符)编码)但是 -

在这种情况下 - 脚本不在面向公众的网站上而且我不会b / b
在任何公共场合使用这种脚本facin g。谢谢你。'


Crimperman



I did know about it (the other relevant characters are encoded) but -
in this case - the script is not on a public facing site and I don''t
use this kind of script on any of the public facing ones. Thanks tho''.

Crimperman


Crimperman写道:
Crimperman wrote:
问题是页面的URI本身包含CGI参数
(例如 http://www.foo.com/script.cgi?p=1&r=2 )并将这些内容传送到包含锚点的URI (例如
http:// www.foo.com/script.cgi?p=1&r=2#foo )。

这些包含参数和锚点的URI在IE(6及以下版本)中工作
但不是Moziall,Firefox,Konqueror或Opera。关于我可以做什么来实现跨浏览器启用相同功能的任何想法?
The problem is that the URI of the page itself contains CGI parameters
( e.g. http://www.foo.com/script.cgi?p=1&r=2 ) and these are carried
over to the URIs containing the anchors ( e.g.
http://www.foo.com/script.cgi?p=1&r=2#foo ).

These URIs containing parameters and anchors work in IE (6 and below)
but not in Moziall,Firefox, Konqueror or Opera. Any ideas on what I can
do to enable the same functionality cross-browser?




他们应该只在任何地方工作。您的链接目标是什么样的? < a

name =" #foo"> ...< / a>是一个常见的错误(名字中不应该有#字符

)。


-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>

首页是〜/ .bashrc的位置



They should just work everywhere. What does your link target look like? <a
name="#foo">...</a> is a common mistake (there shouldn''t be a # character
in the name).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


这篇关于在单个URI中指定锚点和cgi参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆