时间:2021-07-01 10:21:17 帮助过:46人阅读
session_start();
require_once('pic_fns.php');
include("upload.class.php");
$edit_me = $_POST['edit_me']; //checkbox选中的数据储存在 edit_me数组中
$valid_user = $_SESSION['valid_user']; //检测是否登录
do_html_header("上传图片广告 Upload pic for machine");
try{
check_valid_user(); //检测是否登录
}catch(Exception $e){
echo $e->getMessage();
do_html_url('login_admin.php','返回');
do_html_footer();
exit;
}
foreach ($edit_me as $k){ //循环上传图片,提交后显示WARNING foreach的数据为空
if($_POST['submit']){ //图片上传部分
$image = new upload_image();
$image->get_file_dir("pic/".$k."/"); //文件存放目录
$image->get_upload_name($_FILES['file']['name']);
$image->get_upload_size($_FILES['file']['size']);
$image->get_upload_type($_FILES['file']['type']);
$image->get_upload_tamp($_FILES['file']['tmp_name']);
$image->upload();
display_user_menu();
do_html_footer;
}
}
?>
display_user_menu();
do_html_footer;
?>