make a php script
<?php
$site_url = $_GET['site_url'];
$allowedReferer = 'https://gingerbook.com'; // Replace with your own domain
// Check if the Referer header is set
if (isset($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
// Check if the Referer matches the allowed domain
if (strpos($referer, $allowedReferer) === 0) {
$url = "http://free.pagepeeker.com/v2/thumbs.php?size=l&url=" . $site_url;
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);
// output to browser
header("Content-type: image/jpeg");
echo $image;
// Referer matches, allow access
// Your PHP code goes here
} else {
// Referer does not match, show an error or redirect to an error page
echo "Not Authorised";
exit();
}
} else {
// Referer header is not set, show an error or redirect to an error page
echo "Access denied.";
exit();
}
// Your PHP code goes here
// ...
?>