Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function youShalDie() {
- echo "<h1>YOU SHALL NOT PASS!!</h1>";
- die;
- }
- if ("GET" == $_SERVER["REQUEST_METHOD"]) {
- if (isset($_SERVER["HTTP_ORIGIN"]) || isset($_SERVER["HTTP_REFERER"])) {
- $allowedOrigin = "https://www.google.com.br/";
- if (
- strpos($allowedOrigin, $_SERVER["HTTP_ORIGIN"]) === FALSE &&
- strpos($allowedOrigin, $_SERVER["HTTP_REFERER"]) === FALSE
- ) {
- youShalDie();
- }
- } else {
- youShalDie();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement