/** * * * @access public */ function add_save() { $img_url = get_post_value('img_url'); $language = get_post_value('language'); $website_name_th = get_post_value('website_name_th'); $website_name_cn = get_post_value('website_name_cn'); $orders = get_post_value('order'); $filename = get_post_value('filename'); $num = count($filename); //print_r($filename); $m = new Website(); if ($filename != '' && count($filename) > 0) { $field = array('img_url' => $img_url, 'language' => $language, 'website_name_th' => $website_name_th, 'website_name_cn' => $website_name_cn, 'orders' => $orders, 'status' => '10000', 'img_path' => '/Upload/' . $filename[0], 'created' => date('Y-m-d H:i:s', time())); $m->clear(); $m->setTable('vcb_index_website'); $m->setField($field); $websiter_id = $m->insert(); } if (!$websiter_id) { echo '<br>保存失败<br>'; } else { echo '<br>保存成功,<a href="add">继续添加</a>,<a href="website">返回</a><br>'; } }