$html->clear(); unset($html); } exit; */ /* $str = "<img src='http://www.benhu.com/images/upload/fckautosave/201409/1410747983-2.jpg' data-cls='fdsf'>" ; $str = addslashes($str); $sql = "UPDATE ecs_goods SET goods_desc = '$str' WHERE goods_id = 1"; // .$good['goods_id']; $db->query($sql); exit; */ $sql = "SELECT goods_id,goods_desc FROM ecs_goods WHERE goods_id >= 2676 ORDER BY goods_id ASC"; $goods = $db->getAll($sql); foreach ($goods as $key => $good) { $html = str_get_html($good['goods_desc']); foreach ($html->find('img') as $element) { $element->style = null; $element->align = null; $element->class = null; } // echo $element->src . '<br>'; //$str = $html->innertext ; $str = $html; $str = addslashes($str); $sql = "UPDATE ecs_goods SET goods_desc = '{$str}' WHERE goods_id = " . $good['goods_id']; $db->query($sql); $html->clear(); unset($html);
$_POST = empty($_POST) ? '' : input_filter($_POST); $_COOKIE = empty($_COOKIE) ? '' : input_filter($_COOKIE); $_FILES = empty($_FILES) ? '' : input_filter($_FILES); } //开始获得客户端的参数 $ip = ip(); $referer_url = referer_url(); $url = url(); //初始化数据库 $db = new cls_mysql(); $db->connect($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect); unset($dbhost, $dbuser, $dbname, $charset, $pconnect); //获取网站配置信息 $config = array(); $sql = 'SELECT * FROM ' . table('config'); $res = $db->getAll($sql); foreach ($res as $row) { $config[$row['key']] = $row['value']; } $page_size = $config['page_size']; unset($res); //初始化模板 $smarty = new Smarty(); if (defined('IN_PBADMIN')) { $smarty->template_dir = PBBLOG_ROOT . '/' . PBBLOG_WS_ADMIN . '/templates'; $smarty->compile_dir = PBBLOG_ROOT . '/home/admin_compiled'; $smarty->caching = false; } elseif (!defined('IN_PBADMIN')) { $smarty->template_dir = PBBLOG_ROOT . '/themes/' . $config['template_name']; $smarty->compile_dir = PBBLOG_ROOT . '/home/compiled'; //开启缓存