0
創建文件夾和子文件夾(鏈接到數據庫用戶標識符)。未創建用戶圖像的子文件夾。圖像應置於用戶文件夾中用戶yploads it.Please如果有人能幫助,並給編碼它相對於我的編碼please.Here低於自動創建文件夾和子文件夾(鏈接到用戶標識符的子文件夾)
session_start();
$ds = DIRECTORY_SEPARATOR;
$storeFolder = '../../advertiser_images/'.str_replace("#","",$_SESSION["userID"]);
if (!empty($_FILES))
{
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = dirname(__FILE__) . $ds. $storeFolder . $ds;
$targetFile = $targetPath.$_SESSION["vid"].str_replace(" ","",$_FILES['file']['name']);
move_uploaded_file($tempFile,$targetFile);
}
include_once '../../modules/database/db-functions.php';
$data = array();
$data[0] = 'booklook';
$data[1] = 'book_images';
$data[2] = 'vid';
$data[3] = '#'.$_SESSION["vid"];
$data[4] = 'did';
$data[5] = $_SESSION["userID"];
$data[6] = 'iid';
$data[7] = $_SESSION["vid"].str_replace(" ","",$_FILES['file']['name']);
$data[8] = 'img_loc';
$data[9] = 'advertiser_images/'.str_replace("#","",$_SESSION["userID"]).'/'.$_SESSION["vid"].str_replace(" ","",$_FILES['file']['name']);
add($data);
您到目前爲止嘗試過的東西。 –
那麼我不知道錯在哪裏,所以我沒有試圖解決它 – Iry