限制html页面访问问题 [英] limit html page access question

查看:170
本文介绍了限制html页面访问问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我正在创建一个有几页的网站...问题是,我怎么能

阻止用户直接进入页面。


即用户必须通过myPage1.asp(页面需要一些用户信息)

才能访问myPage2.htm。我不希望用户无需通过myPage1.asp上的调查问卷就可以获得
myPage2.htm。


我怎么能这样做吗?

谢谢,

Ann

Hi!
I''m creating a website that has a few pages... question is, how can I
prevent a user from going directly to a page.

i.e. user has to go through myPage1.asp (page takes some user info)
to get to myPage2.htm. I don''t want the user to be able to get to
myPage2.htm without going through the questionnaire on myPage1.asp.

How can I do this?
Thanks,
Ann

推荐答案

Ann D.写道:
嗨!
我正在创建一个有几页的网站...问题是,我怎么能阻止用户直接进入某个页面。

即用户必须通过myPage1.asp(页面需要一些用户信息)
才能访问myPage2.htm。我不希望用户无需通过myPage1.asp上的调查问卷就可以访问
myPage2.htm。
Hi!
I''m creating a website that has a few pages... question is, how can I
prevent a user from going directly to a page.

i.e. user has to go through myPage1.asp (page takes some user info)
to get to myPage2.htm. I don''t want the user to be able to get to
myPage2.htm without going through the questionnaire on myPage1.asp.




你可以'用HTML做这件事。您需要使用服务器端页面

技术(如ASP,JSP,PHP)动态生成页面。然后,

您将能够设置会话变量。当第一页要求

时,服务器上维持的值为用户当前会话的持续时间。第二页将检查

变量。如果存在,第二页的实际内容将是

发送;否则,将发送通知用户他的错误的消息

- 或者,为了方便用户,第二页可以自动重定向

他第一页。


你也可以在网页中使用cookies和Javascript,

这样做但是这种技术对于任何Javascript是的浏览器都会失败不是

存在并启用。



You can''t do this with HTML. You would need to use a server-side page
technology like ASP, JSP, PHP to generate your pages dynamically. Then,
you would be able to set a "session variable" when the first page is
requested, a value that is maintained on the server for the duration of
the user''s current "session". The second page would check for that
variable. If it exists, the actual content of the second page would be
sent; otherwise, a message notifying the user of his error would be sent
instead--or, for the user''s convenience, the second page could redirect
him automatically to the first page.

You could also do this within the web page using cookies and Javascript,
but this technique would fail for any browser in which Javascript is not
present and enabled.


感谢您的信息...所以,如果我将myPage2.htm更改为myPage3.asp,如何

以及会话变量在哪里?另外,我的网站可以包含一大堆htm和asp文件吗?

你可能会说,我对此很新。

再来一次,

Ann

Thanks for the info... So if I change myPage2.htm to myPage3.asp, how
and where does the session variable go? Also, can my site consist of a
bunch of htm and asp files?
As you can probably tell, I''m very new at this.
Thx again,
Ann


一个******* @ yahoo.ca 写道:
感谢您的信息...所以如果我将myPage2.htm更改为myPage3.asp ,会话变量怎么去?


这不仅仅是改变文件扩展名的问题。你必须学习如何创建一个ASP页面。

另外,我的网站可以包含一堆htm和asp文件吗?


是的,它可以同时拥有。

正如你可能知道的那样,我对此非常陌生。
Thanks for the info... So if I change myPage2.htm to myPage3.asp, how
and where does the session variable go?
It''s not just a matter of changing the file''s extension. You have to
learn how to create an ASP page.
Also, can my site consist of a
bunch of htm and asp files?
Yes, it can have both.
As you can probably tell, I''m very new at this.




这很好,但你必须获得一些非常基本的ASP技能才能使用

这种技术。



That''s fine, but you do have to acquire some very basic ASP skill to use
this technique.


这篇关于限制html页面访问问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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