页面只能通过链接访问 [英] Page only accessible through link

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

问题描述

我正在制作一个网站,在某些时候我希望一些用户填写表格,目前这些用户必须注册然后登录并填写表格.然而,我有一个想法,因为它只是一种形式,用户忘记了密码等,并不断给我打电话,我只会向他们发送一个带有表单的页面链接.

I am making a website where at some point I want some users to fill in a form, currently these users have to register and then login and fill in the form. However I had the idea that as it's only one form and the users are forgetful of passwords etc etc and keep ringing me with problems, that I will just send them a link to the page with a the form.

然而,我不希望其他人能够通过输入 URL 来访问表单,因此机器人也可以访问表单并向我的收件箱发送垃圾邮件.那么有没有办法将一种安全传递的东西合并到链接和 php 页面中,有点像 www.mylink.php?pass='yhgdfu8' 如果你明白我的意思.

I don't however want anyone else to be able to access the form by typing in the URL and as such also have bots be able to access the form and spam my inbox. So is there a way to incorporate a kind of secure pass thing into the link and php page, kinda like www.mylink.php?pass='yhgdfu8' if you get my drift.

感谢任何帮助.

提前致谢.

伊恩

只是为了澄清我不建议将密码放入 URL,也许有一个我将发送的电子邮件表格,然后只允许访问该页面,如果来自表格的电子邮件匹配,这可能吗?

Just to clarify im not suggesting putting the password into the URL, maybe having a Table of emails that i will be sending out and then only allowing access to the page if the email coming from matches that on the table, is that possible?

推荐答案

看看

$_SERVER["HTTP_REFERER"];

您可以根据该变量的值进行限制,但并不完美.

You can restrict based on the value of this variable, but it is not perfect.

重要说明 - http://php.net/manual/en/reserved.variables.server.php

并非所有用户代理都会设置此项,有些提供修改 HTTP_REFERER 作为功能的功能.简而言之,它真的不能被信任.

Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

更多信息:HTTP_REFERER 的可靠性如何?

这篇关于页面只能通过链接访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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