php隱藏圖片
❶ php如何隱藏圖片的真實地址
樓主你好,PHP可以使用base64編碼來隱藏圖片真實地址哦,隱藏後會顯示data:QUFodHRwOi8vd3d3LmJhaWR1這種格式的圖片地址,向某寶這類網站目前都是使用這種方式,並且可以提高載入速度,具體的PHP代碼可以如下:
<?php
header('Content-type: text/html; charset=utf-8');
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
if (!isset($_FILES['file'])) exit('請上傳圖片');
$file = $_FILES['file'];
$dataType = array('png', 'jpg', 'jpeg', 'gif');
$ext = strtolower(substr(strrchr($file['name'], '.'), 1));
if (!isset($file['tmp_name']) || $file['error'] > 0) exit('上傳失敗');
if (!in_array($ext, $dataType)) exit('圖片格式錯誤');
$file = file_get_contents($file['tmp_name']);
$data = base64_encode($file);
echo 'data:image/'.$ext.';base64,'.$data;
} else {
?>
<html>
<head><title>圖片base64編碼</title></head>
<body>
<form method="post">
<input type="file">
<input type="submit" value="提交">
</form>
</body>
</html>
<?php
}
?>
❷ javascript php如何隱藏圖片真實地址用問號的形式表示.
這是因為怕被盜圖,或者被破譯。很簡單地,所有的圖片顯示都是從一個img.php 出去,後面上?後面跟參數,img.php頁面根據不同的參數,才找到伺服器上的圖片。
img.php代碼示例:
header("Content-type: image/png;charset=utf8"); //該頁面是顯示圖片的
$im = imagecreatefromjpeg("../img/mat/ad/linktech/{$v}/{$s}.jpg"); //根據不同參數找到對應的圖片
header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
header("Content-type: image/png;charset=utf8");
imagepng($im); //顯示圖片文件
imagedestroy($im);
如果參數錯誤,或者訪問沒有session控制,就不顯示圖片。
❸ php文本框後面跟個圖片怎樣隱藏
你得說明白啊 最起碼給個圖片或者代碼什麼的啊 不然怎麼回答啊
❹ 求用PHP將遠程調用的圖片地址隱藏的方法
寫一個 image.php 通過傳遞參數來決定顯示什麼圖片;image.php:<?php$url = isset($_GET['url']) ? trim($_GET['url']) : '';if (!empty($url)){ echo $url;}else{ echo 'error';} <img src="image.php?url= http://xxx.com/xxx.jpg">
❺ php 隱藏圖片難題!!!
<img src="a.php"> 存為b.htm
<?php
$file = "https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-.gif";
$pic = file_get_contents($file);
header("Content-type: image/*");
echo $pic;
?>
存為a.php
然後訪問b.htm
❻ php隱藏圖片真實地址代碼
/*圖片轉換為base64格式編碼*/
$img='uploads/01.png';
$base64_img=base64EncodeImage($img);
echo'<imgsrc="'.$base64_img.'"/>';
functionbase64EncodeImage($image_file){
$base64_image='';
$image_info=getimagesize($image_file);
$image_data=fread(fopen($image_file,'r'),filesize($image_file));
$base64_image='data:'.$image_info['mime'].';base64,'.chunk_split(base64_encode($image_data));
return$base64_image;
}
你可以把圖片內容轉為base64的,這樣就不會圖片的地址了,但是頁面體積會變大,
<img src="base64之後的值 />
❼ php3.0默認升級版的首頁那個查詢訂單狀態下的圖片怎麼隱藏
那圖片一般都是調用住哪聯盟的,不佔你本地空間的。 查看原帖>>
❽ 求用PHP將遠程調用的圖片地址隱藏的方法
簡單一點的是直接用base64_encode編碼和base64_decode解碼。如下:
//圖片輸出頁 imageOutput.php
<html>
<head>
<title>OutPut Image</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
</head>
<body>
<div><img src="http://www.test.com/getImage_process.php?id=<?php echo base64_encode('http://img01.taobaocdn.com/bao/uploaded/i1/T1KNuWXdlgXXXBSUbb_095424.jpg_460x460.jpg')?>"/></div>
</body>
</html>
//圖片處理頁 getImage_process.php
<?php
$url = base64_decode ($_GET['id']);
echo file_get_contents($url);
//End_php
❾ php隱藏圖片真實地址代碼怎麼用
<?php
/**
* @molar 這個腳本將會隱藏圖片的真實地址
* @param name string 圖片名稱
* @example <img src=" http://www.xxx.com/getImg.php?name=demo.jpg" />
* 等同於 <img src=" http://www.xxx.com/images/demo.jpg" />
*/
//設置圖片真實地址所在的文件夾,您所帖的代碼當中少了一個分號.程序會報錯
$image_path="images/";
//從URL當中得到文件名.比方說本程序的名字為getImg.php,傳入參數name=demo.jpg
//即URL地址為getImg.php?name=demo.jpg,
$image_file=$image_path.$_GET['name'];
//以只讀模式打開文件
$sTmpVar = fread(fopen($image_file, 'r'), filesize($image_path));
//設置文件頭顯示為圖片.
header("Content-type: image/* ");
//輸出數據流
echo $sTmpVar;
?>
❿ Php隱藏圖片地址,asp隱藏圖片地址怎樣才能查到。
用調試工具,f12就可以看