//文件域的名字
//处理方法
//新图
if(!empty($_FILES['attach']['tmp_name']) && is_uploaded_file($_FILES['attach']['tmp_name'])){
$query = DB::query("select filename,filepath from pre_home_hall_pic where picid =$picid ");
while ($value = DB::fetch($query)) {
$oldfilepath=$value['filepath'];
$filename =$value['filename'];
}
$file_info = pathinfo($_FILES['attach']['name']);
$ext = $file_info['extension'];// 取扩展名
$filepath = dirname($oldfilepath).'/'.date('His').strtolower(random(16)).'.'.$ext;//随机重命名
$uploadpath = 'data/attachment/hall/'.$filepath;
if(!is_dir('data/attachment/hall/'.$oldfilepath)){
unlink('data/attachment/hall/'.$oldfilepath);
unlink('data/attachment/hall/'.$oldfilepath.'.thumb.jpg');
}
$res = move_uploaded_file($_FILES['attach']['tmp_name'], $uploadpath);
if($res){
require_once libfile('class/image');
$image = new image();
$result = $image->Thumb($uploadpath, '', 140, 140, 1);
}
$data['filename'] = $_FILES['attach']['name'];
$data['filepath'] = $filepath;
}
DB::update('home_hall_pic', $data, $wherearr);
良精商城网店购物系统是一套能够适合不同类型商品、超强灵活的多功能在线商店系统,三级分销 PC+移动端+微网站,为您提供了一个完整的在线开店解决方案。良精网店购物系统除了拥有一般网上商店系统所具有的所有功能,还拥有着其它网店系统没有的许多超强功能。多种独创的技术使得系统能满足各行业广大用户的各种各样的需求,是一个经过完善设计并适用于各种服务器环境的高效、全新、快速和优秀的网上购物软件解决方案。
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号