如何限制用户输入直接网址 [英] How to restrict user to enter direct url

查看:104
本文介绍了如何限制用户输入直接网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我想限制用户输入直接网址.

如果用户尝试输入url,则应重定向回用户访问的最后一页.


我使用了Request.ServerVariables ["HTTP_REFERER"].当用户输入直接URL时,它将返回"Null".

这样我就可以得到用户输入的直接网址

但是如何将用户重定向到他/她访问的最后一页?

有没有其他更好的替代方法可以实现呢?

请指教.

谢谢

Advay Pandya

Hi all

I want to restrict user to enter direct url.

If user tries to enter url then it should redirect back to the last page that the user visited.


I used Request.ServerVariables["HTTP_REFERER"] . When user enters direct url then it returns "Null".

So I can get , user entered direct url

But how to redirect the user to the last page he/she visited ?

Is there any preferable alternative way to implement this ?

Please advise.

Thanks

Advay Pandya

推荐答案

请参阅类似的讨论:
如何防止URL输入并将用户重定向到登录页面 [如何将用户重定向到ASP.未经授权的NET页面 [
Refer similar discussion:
How do I prevent URL entry and redirect the user to login page[^]
How to Redirect Users to an ASP.NET page when not Authorized[^]




我使用了Request.ServerVariables ["HTTP_REFERER"].当用户输入直接网址时,它将返回"Null".

我不知道ServerVariables.感谢您提供的信息.

要获取上一页URL,请参考
此链接 [
Hi,

I used Request.ServerVariables["HTTP_REFERER"] . When user enters direct url then it returns "Null".

i don''t know about ServerVariables. thanks for the information.

for getting previous page URL please Refer this link[^]

hope this will help you

thanks
-Amit.


这篇关于如何限制用户输入直接网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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