首页 > 代码库 > php function集合
php function集合
/*更新商品的某个字段*/function update_goods($goods_id, $field, $value){ if ($goods_id) { /* 清除缓存 */ clear_cache_files(); $sql = "UPDATE " . $GLOBALS[‘ecs‘]->table(‘goods‘) . " SET $field = ‘$value‘ , last_update = ‘". gmtime() ."‘ " . "WHERE goods_id " . db_create_in($goods_id); return $GLOBALS[‘db‘]->query($sql); } else { return false; }}function message($msg, $url = NULL, $type = ‘succeed‘, $waitSecond = 2) { if ($url == NULL) $url = ‘javascript:history.back();‘; if ($type == ‘error‘) { $title = ‘错误信息‘; } else { $title = ‘提示信息‘; } $data [‘title‘] = $title; $data [‘message‘] = $msg; $data [‘type‘] = $type; $data [‘url‘] = $url; $data [‘second‘] = $waitSecond; $this->assign(‘data‘, $data); $this->display(‘message‘); exit(); } // 弹出信息function alert($msg, $url = NULL, $parent = false) { header("Content-type: text/html; charset=utf-8"); $alert_msg = "alert(‘$msg‘);"; if (empty($url)) { $gourl = ‘history.go(-1);‘; } else { $gourl = ($parent ? ‘parent‘ : ‘window‘) . ".location.href = http://www.mamicode.com/‘{$url}‘"; } echo "<script>$alert_msg $gourl</script>"; exit(); }
php function集合
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。