问题是当引用者不为空时,我仍然得到链接而不是图像。
<?php
if($_SERVER['HTTP_REFERER'] != " "){
$goodreferer = 0;
}
else {
$goodreferer = 1;
}
$image = 'http://www.example.com/imglink.gif';
$url = 'http://example.net/';
if ($show = 1 && $goodreferer = 1) {
header("Location: ".$url);
}
else {
header("Location: ".$image);
exit;
}
?>