Home  >  Article  >  Backend Development  >  php如何隐藏图片的真实地址_PHP

php如何隐藏图片的真实地址_PHP

WBOY
WBOYOriginal
2016-06-01 12:34:501232browse

$image_path="images/"
$image_file=$image_path.$_GET['name'];
$sTmpVar = fread(fopen($image_file, 'r'), filesize($image_path));
header("Content-type: image/* ");
echo $sTmpVar;
?>

这段代码不光可以隐藏图片,代码后三行不用改,连FLASH真实地址也可以隐藏.
用这个结合其它技术可以防止盗链.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn