$file1['file_size'] = round($file_size / 1024, 2) . 'M'; } else { $file1['file_size'] = round($file_size, 2) . 'K'; } $file1['server'] = SITE_URL; break; default: $resource_type = 1; } array_push($files, $file1); // 3.插入数据库 $sql = "insert into " . TB_PREFIX . "resource_list(resource_url,width,height,size,oname) values('{$resource_url}',{$r_width},{$r_height},{$r_size},'{$r_oname}')"; /** * die('<script>alert(\''.$sql.'\');</script>'); */ $dbm->query_insert($sql); } // 没得到数组,打印错误信息 if (count($files) <= 0) { die('<script>alert(\'' . json_encode($result) . '\');</script>'); } // 4.跳转到之前的域名进行参数回调 $params = urlencode($params); //判断是否带端口域名 $port = $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']; die('<script>window.location.href="http://' . $json_params->domain . $port . SITE_PATH . 'upload/callback.php?params={\\"params\\":' . $params . ',\\"files\\":' . urlencode(json_encode($files)) . '}";</script>'); function get_android($i) { $a = array(1 => '1.0', 2 => '1.1', 3 => '1.5', 4 => '1.6', 5 => '2.0', 6 => '2.0.1', 7 => '2.1.x', 8 => '2.2.x', 9 => '2.3.0-2.3.2', 10 => '2.3.3,2.3.4', 11 => '3.0.x', 12 => '3.1.x', 13 => '3.2', 14 => '4.0,4.0.1,4.0.2', 15 => '4.0.3,4.0.4', 16 => '4.1,4.1.1', 17 => '4.2'); foreach ($a as $k => $v) { if ($k == $i) {