我想知道如何让http引用超过1个网站。如何让超过1个网站的http referer
例如
<?php
$domain='example.net';
$referrer = $_SERVER['HTTP_REFERER'];
if (@preg_match("/example.net/",$referrer)) {
} else {
header('Location: http://www.example.net/404.php');
};
?>
如果我打开链接从example.net此代码的工作,但我想允许example1.net和example2.net以及访问的链接。
我该怎么做?如果有人可以帮助我,这将非常感激。
如果你的目标是从除非在引用作为安全性的方法存在访问此页面震慑人心,但应注意的是,它很容易被欺骗。 – Ohgodwhy 2014-10-07 06:25:56
只是一个音符 - 在上面的代码中,变量$ domain,不会在任何地方使用。 – 2014-10-07 06:27:28