<?php
// Own Domain (" without; www." or such a thing)
$selfdomain = "bsp-url.de";
// Listing of the pictures (no Slash at the end!)
// Relative to the listing of this PHP Skriptes
$imgdir = "secret pictures";
// Additionally Domain permitted
$allowdomain = "bsp-url.com";
$selfdomain = strtoupper($selfdomain);
$allowdomain = strtoupper($allowdomain);
$ref = strtoupper($HTTP_REFERER);
//minutes remove
$ref = str_replace("HTTP://", "", $ref);
// domain extract
if (strpos($ref, "/")) $ref = substr($ref, 0, strpos($ref, "/"));
if (($ref=="") || (strpos($ref, $allowdomain)) || (strpos($ref, $selfdomain))) {
$fn = $PATH_INFO;
if ((strpos($fn, "../")) || (strpos($fn, "..\\")))
{
echo "Access injury; "; // Servers protect
} else readfile($imgdir.$fn); // File spend
} else {
echo "No access";
}
?>
|