doucaigai7176 2013-07-30 09:24
浏览 20

使用逗号分隔符一列上传多个图像并插入文件名

using for loop i had upload multiple images and image names saved in database in single column using comma separator is working fine but problem is that now i have to edit same form having five images i have to edit one or two images save the form it should save images path previous one as it is and also new edited.....

    $target = "upload/storage_logo/"; 
    $target = $target . basename( $_FILES['add_facility_logo']['name'] ) ; 

if(count($_FILES["add_storage_image"]['name'])>0) {

    for($j=0; $j < count($_FILES["add_storage_image"]['name']); $j++) 
    { 
       $target = "upload/storage_images/"; 
       $target = $target . basename( $_FILES['add_storage_image']['name'][$j] ) ; 

       if( ($_FILES['add_storage_image'] ['error'][$j] == 0) && ($_FILES ['add_storage_image'] ['size'][$j] > 0)) { 

        move_uploaded_file($_FILES['add_storage_image']['tmp_name'][$j], $target);

        }

    }

}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统