我想知道如何讓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