php上傳圖片獲取路徑
『壹』 php fckeditor 上傳的圖片默認的那個userfiles文件夾在哪
config.php 裡面的
然後
$Config['Enabled'] = true ; //先設為true,
$Config['UserFilesPath'] = '/userfile/' ;
這個路徑就是相對你程序(網站根目錄的路徑),你自己建個目錄也可以,如果沒有建,系統會自動建的。
比如/userfile/就是根目錄下userfile文件夾。
『貳』 php讀取圖片的路徑
你的代碼是遍歷$dir文件夾下面的文件,然後輸出成<img src=""/>,訪問伺服器上的圖片一般是網址+具體路徑,例如:localhost/public/logo.jpg,是指訪問網址根目錄下的public/logo.jpg文件,對應你這里的就是htdocs/public/logo.jpg
圖片的顯示大小可以設置img的width和heigth屬性,位置可以設置相應的css值,例如<img src="/public/logo.jpg" width="100px" heigth="100px" style="display:block;margin:0 auto">
『叄』 PHP+Mysql要如何做才能上傳圖片後在資料庫中顯示圖片路徑,要能用的!
在上傳代碼中首先獲取上傳文件圖片的文件名$filename,然後insert的時候將獲取的文件名insert到adminphoto中
mysql_query("insert into admindata (adminphoto) values ('images/".$filename."')")
顯示的時候
<img src="<?=$AdminPhoto?>">" width="111" height="144">
$AdminPhoto為查詢到你資料庫的圖片路徑
$AdminPhoto替換成$rs->AdminPhoto
『肆』 PHP怎麼上傳圖片路徑,怎麼獲取圖片路徑
$filePath 應該是上傳的臨時文件吧,然後將$filePath,這個文件移動到 $uploadPath,$uploadPath,應該就 你已經上傳的圖片的路徑!包含圖片文件的名稱。
『伍』 php中如何調用資料庫中的圖片並且顯示到頁面
php是採用二進制形式存儲圖片及讀取顯示的,首先通過代碼創建數據表,然後上傳圖片伺服器再通過瀏覽器顯示,具體編程代碼舉例:
1、首先需要創建數據表,具體代碼如下圖所示。
『陸』 php thinkphp 怎麼獲取上傳圖片的路徑
$info = $upload->upload ();
$data ['表單名稱'] = $info ['表單名稱'] ['savepath'] . $info ['表單名稱'] ['savename'];
『柒』 用PHP獲取鏈接及圖片路徑的方法
<?php
$str="Thisisatest.Thisisatest.Thisisa<ahref=http://link1.com><imgsrc=http://img1.jpg/></a>test.Thisisatest.Thisisatest. ".
"Thisisatest.Thisisatest.<ahref=http://link2.com><imgsrc=http://img2.jpg/></a>Thisisatest.Thisisatest.Thisisatest. ".
"<ahref=http://link3.com><imgsrc=http://img3.jpg/></a>";
$regex='/<as+href=(.*)s*><imgs+src=(.*)s*/></a>/';
$output=array();
if(preg_match_all($regex,$str,$matches)!==false){
if(isset($matches[1])&&isset($matches[2])){
$links=$matches[1];
$imgs=$matches[2];
foreach($linksas$key=>$link){
$img=isset($imgs[$key])?$imgs[$key]:'';
$output[]="<ahref="{$link}"><imgsrc="{$img}"/></a>";
}
}
}
var_mp($output);