function addToDB()
 {
     if (count($this->error_msg) > 0) {
         echo '<pre>出现了一下致命错误:<br>';
         echo 'from_url:' . $this->from_url;
         echo '<br>';
         print_r($this->error_msg);
         exit;
     }
     $insert_product = array();
     $insert_product_desp = array();
     $update_products_id = $this->update_products_id;
     $products_cat = $this->products_cat;
     $language_id = $this->language_id;
     if (empty($products_cat)) {
         die('error: empty category.');
     }
     /****************begin init*******************/
     $now = date("Y-m-d H:i:s");
     $insert_product = array('products_quantity' => '10000', 'products_status' => '1', 'manufacturers_id' => '0', 'products_quantity_mixed' => '1', 'products_model' => '', 'products_afterbuy_model' => '', 'products_discount_type' => '1', 'products_price' => 0, 'products_image' => '', 'master_categories_id' => $products_cat, 'products_date_added' => $now, 'products_last_modified' => $now);
     if ($products_cat == 130) {
         $insert_product['products_weight'] = '1400';
     } else {
         $insert_product['products_weight'] = '600';
     }
     $insert_product_desp = array('products_id' => '', 'language_id' => $language_id, 'products_name' => '', 'products_description' => '', 'products_short_description' => '');
     /****************end init*******************/
     $insert_product['products_image'] = trim($this->product_info['product_image']);
     $insert_product['products_image'] = preg_replace('#^/?images?/?#i', '', $insert_product['products_image']);
     //过滤掉路径中的/images/
     if (strlen($insert_product['products_image']) >= 64) {
         $new_products_image = dirname($insert_product['products_image']) . '/' . date('YmdHis') . strrchr($insert_product['products_image'], '.');
         @rename(IMAGE_PATH . $insert_product['products_image'], IMAGE_PATH . $new_products_image);
         $insert_product['products_image'] = $new_products_image;
     }
     $insert_product['products_model'] = $this->products_model;
     $insert_product['products_afterbuy_model'] = $this->products_afterbuy_model;
     $insert_product['products_price'] = $this->product_info['price'];
     $insert_product_desp['products_name'] = $this->product_info['title'];
     $insert_product_desp['products_description'] = $this->product_info['description'];
     $insert_product_desp['products_short_description'] = $this->product_info['title'];
     $site_name = $this->site_name;
     //添加记录
     $this->new_products_id = addProductBackEver(array('from_url' => $this->from_url, 'site_name' => $site_name, 'products' => $insert_product, 'products_description' => $insert_product_desp, 'update_products_id' => $update_products_id, 'categories_id' => $products_cat));
     //echo '$this->new_products_id:'. $this->new_products_id;exit;
     return $msg = '添加产品成功。';
 }
    createDirIfNotExists($local_img_url);
    saveFile($remote_img_url, $local_img_url);
    //产品详情图----end
    //产品详情1
    $preg = '~<td class="news3">&nbsp;Product Specifications</td>(?:\\s|.)+?<td height="165" valign="top" style="color:#333333;">((?:\\s|.)+?)</td>~';
    preg_match($preg, $content, $arr);
    $pro_desp = $arr[1];
    //print_r($arr);
    //产品详情2
    $preg = '~<td class="news3">&nbsp;User Guide</td>(?:\\s|.)+?<td height="165" valign="top" style="color:#333333;">((?:\\s|.)+?)</td>~';
    preg_match($preg, $content, $arr);
    $pro_desp2 = $arr[1];
    //print_r($arr);
    $insert_product_desp['products_description'] = $pro_desp . $pro_desp2 . '<img src="/images/' . $save_img_dir . '/' . basename($pic_desp);
    //添加记录
    addProductBackEver(array('products' => $insert_product, 'products_description' => $insert_product_desp, 'categories_id' => $products_cat));
    $msg = '添加产品成功。';
}
$FCKeditor = create_html_editor('test', '');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add product</title>
<style type="text/css">
html,body{font-family:tahoma,arial,宋体,sans-serif;font-size:12px;padding:0px;margin:0px;}
.wrap{border:1px solid #ccc;margin:50px 100px;}
table{width:100%;border-collapse:collapse;border:1px solid #ccc;}
td{padding:5px 10px;border:1px solid #ccc;}
.align_right{text-align:right;}