Exemple #1
0
 * @package		ArthurXF
 * @subpackage	Newspapers_magazines
 */
require_once '../config/config.inc.php';
require_once "../class/Newspapers_magazines.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new Newspapers_magazines();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['type_id']) || empty($_POST['title']) || empty($_POST['intro'])) {
        check::AlertExit("错误:有必填选项没填!", -1);
    }
    //新图上传
    set_time_limit(0);
    foreach ($_FILES as $key => $val) {
        if (strrpos($key, 'Filedata') === false) {
            continue;
        }
        $num = substr($key, strlen('Filedata'));
        if (!empty($_FILES['Filedata' . $num]['name'])) {
            $arrTemp = array();