服务器变量问题 [英] Server Variables Question

查看:47
本文介绍了服务器变量问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一段简单的代码很难。

我有一个网页(在经典的asp中),如果<,我会重定向到登录页面他们没有来自那个页面。


这意味着他们必须通过登录页面访问我的页面。

登录页面...在asp.net中完成并驻留在服务器上将

一旦登录就被定向到默认页面。在此默认情况下

页面...有一个链接访问我的页面,这是在另一台服务器上和

在经典的asp中完成。

在我的页面上我测试看到如果他们来自默认页面。

这是我的代码:

如果request.servervariables(" HTTP_REFERER")<>

http://www.thedefaultpage.com"然后

response.redirect" http://www.theloginpage.com"

结束如果


当我这么做的时候response.write request.servervariables(" HTTP_REFERER")它

显示为空。使用从

aspx页面到asp页面的服务器变量是否有问题?


谢谢

Rob

***通过开发人员指南 http://www.developersdex.com 发送***

不要只是参加USENET ......获得奖励!


I have a simple piece of code which is being difficult.
I have a web page (in classic asp) that will redirect to a login page if
they didn''t come from that page.

Which means that they have to access my page via the login page.

The login page...which is done in asp.net and resides on a server will
be directed to a default page once logged in. On this default
page...there''s a link to access my page which is on another server and
done in classic asp.
On my page I test to see if they came from the default page.
This is my code:
If request.servervariables("HTTP_REFERER") <>
"http://www.thedefaultpage.com" then
response.redirect "http://www.theloginpage.com"
end if

When I do a response.write request.servervariables("HTTP_REFERER") it
show up empty. Is there an issue with using server variables from an
aspx page to an asp page?

Thanks
Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

Shouldn'那是:


如果request.servervariables(" HTTP_REFERER")<>

" http://www.yourserver.com /thedefaultpage.asp"然后

response.redirect" http://www.yourserver.com/loginpage.aspx"

结束如果


????

Juan T. Llibre

ASP.NET MVP

===========

" Rob" < RO **** @ hotmail.com>在消息中写道

新闻:ea ************** @ TK2MSFTNGP15.phx.gbl ...
Shouldn''t that be :

If request.servervariables("HTTP_REFERER") <>
"http://www.yourserver.com/thedefaultpage.asp" then
response.redirect "http://www.yourserver.com/loginpage.aspx"
end if

???
Juan T. Llibre
ASP.NET MVP
===========
"Rob" <ro****@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP15.phx.gbl...

我有一段简单的代码很难。
我有一个网页(在经典的asp中),如果他们没有来自那个页面,它将重定向到登录页面。

这意味着他们必须通过登录页面访问我的页面。

登录页面...在asp.net中完成并驻留在服务器上将
登录后将被定向到默认页面。在此默认页面上......有一个链接可以访问我的页面,该页面位于另一台服务器上,并且在经典的asp中完成。
On我的页面我测试它们是否来自默认页面。
这是我的代码:
如果request.servervariables(" HTTP_REFERER")<>
" http:/ /www.thedefaultpage.com"然后
response.redirect" http://www.theloginpage.com"
结束如果

当我做一个response.write request.servervariables(" HTTP_REFERER")它显示为空。使用从
aspx页面到asp页面的服务器变量是否存在问题?

Rob

***通过Developersdex发送< a rel =nofollowhref =http://www.developersdex.comtarget =_ blank> http://www.developersdex.com ***
不要只是参加USENET ...获得奖励!

I have a simple piece of code which is being difficult.
I have a web page (in classic asp) that will redirect to a login page if
they didn''t come from that page.

Which means that they have to access my page via the login page.

The login page...which is done in asp.net and resides on a server will
be directed to a default page once logged in. On this default
page...there''s a link to access my page which is on another server and
done in classic asp.
On my page I test to see if they came from the default page.
This is my code:
If request.servervariables("HTTP_REFERER") <>
"http://www.thedefaultpage.com" then
response.redirect "http://www.theloginpage.com"
end if

When I do a response.write request.servervariables("HTTP_REFERER") it
show up empty. Is there an issue with using server variables from an
aspx page to an asp page?

Thanks
Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!





雅,我试过了,我只尝试了域名和他们都没有工作。

我不确定究竟会返回什么路径所以我试图在页面上显示

它是一个空字符串。


Rob

***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

Ya, I tried that and I tried just the domain and neither of them worked.
I wasn''t sure exactly what path would be returned so I tried to display
it on the page and it''s an empty string.

Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


你真的意识到,Rob,如果客户已经在你的asp.net服务器上标记了

任何.aspx页面(*不*在

..asp服务器)HTTP_REFERER将为空,

不是吗?


这意味着客户端没有没有从你的.asp页面中提到

,但他们将被允许查看你的

..aspx页面,而不会被重定向。



Juan T. Llibre

ASP.NET MVP

===========
" Rob" < RO **** @ hotmail.com>在留言中写道

新闻:Ov ************** @ TK2MSFTNGP12.phx.gbl ...
You do realize, Rob, that if clients have bookmarked
any .aspx page in your asp.net server ( *not* on the
..asp server ) that HTTP_REFERER will be empty,
don''t you ?

That would mean that the client wasn''t referred from
your .asp page, yet they''d be allowed to view your
..aspx page without being re-directed.


Juan T. Llibre
ASP.NET MVP
===========
"Rob" <ro****@hotmail.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...

Ya ,我试过了,我尝试了域名,但都没有工作。
我不确定究竟会返回什么路径,所以我试图在页面上显示
它是'一个空字符串。

Rob

Ya, I tried that and I tried just the domain and neither of them worked.
I wasn''t sure exactly what path would be returned so I tried to display
it on the page and it''s an empty string.

Rob



这篇关于服务器变量问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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