停止发布来自不同域PHP的数据 [英] Stop Post Data From Different Domain PHP
问题描述
我是PHP的初学者。
I'm a beginner in PHP.
我试图做的是停止发布数据来自其他网页。
What I'm trying to do is stop Post Data coming from another webpage.
我的问题是假设有人复制我的表格并将其粘贴到他们的网站中。我希望能够阻止Post Data在我的电子邮件表单上运行脚本。
The problem I am having is let's say someone copies my form and pastes it in their website. I want to be able to stop that Post Data from running the script on my email form.
我该怎么做?让我知道如果我不够清楚。
How can I do this? Let me know if I'm not being clear enough.
我的PHP联系表单运行在一个带有条件语句的页面上。即如果数据检出,提交。
My PHP Contact form runs on one page with conditional statements. i.e. if data checks out, submit.
推荐答案
$ _ SERVER ['HTTP_Referrer']会很好,但它不可靠。你可以使用隐藏的表单字段,MD5的东西,然后你在另一边检查它。
$_SERVER['HTTP_Referrer'] would be nice but it isn't reliable. You could use a hidden form field that MD5's something and then you check it on the other side.
这篇关于停止发布来自不同域PHP的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!