当前位置: 首页>>代码示例>>PHP>>正文


PHP get_safe_replace函数代码示例

本文整理汇总了PHP中get_safe_replace函数的典型用法代码示例。如果您正苦于以下问题:PHP get_safe_replace函数的具体用法?PHP get_safe_replace怎么用?PHP get_safe_replace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_safe_replace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajax

 function ajax()
 {
     $model = M('Order');
     $id = intval($_POST['id']);
     $order = $model->find($id);
     if ($order['userid'] != $this->_userid) {
         die(json_encode(array('msg' => L('do_empty'))));
     }
     $_POST = get_safe_replace($_POST);
     if ($_GET['do'] == 'saveaddress') {
         $r = $model->save($_POST);
         die(json_encode(array('id' => 1)));
     } elseif ($_GET['do'] == 'order_status') {
         $_POST['status'] = 3;
         $_POST['confirm_time'] = time();
         $r = $model->save($_POST);
         die(json_encode(array('id' => 1)));
     } elseif ($_GET['do'] == 'pay_status') {
         $_POST['pay_status'] = 3;
         $r = $model->save($_POST);
         die(json_encode(array('id' => 1)));
     } elseif ($_GET['do'] == 'shipping_status') {
         $_POST['shipping_status'] = $_POST['num'];
         unset($_POST['num']);
         $_POST['accept_time'] = $_POST['shipping_status'] == 2 ? time() : '';
         $r = $model->save($_POST);
         die(json_encode(array('id' => 1)));
     }
 }
开发者ID:yunsite,项目名称:yourphpcms,代码行数:29,代码来源:OrderAction.class.php

示例2: _initialize

 function _initialize()
 {
     parent::_initialize();
     import('@.EXT.Online');
     new Online();
     $this->dao = M('Cart');
     $this->sessionid = get_safe_replace(cookie('onlineid'));
     $_POST = get_safe_replace($_POST);
 }
开发者ID:bossyuetao,项目名称:yuephp,代码行数:9,代码来源:OrderAction.class.php

示例3: _empty

 public function _empty()
 {
     //空操作 空模块
     if (MODULE_NAME != 'Urlrule') {
         $Mod = F('Mod');
         if (!$Mod[MODULE_NAME]) {
             throw_exception('404');
         }
     }
     $a = ACTION_NAME;
     $id = intval($_REQUEST['id']);
     $catid = intval($_REQUEST['catid']);
     $moduleid = intval($_REQUEST['moduleid']);
     if (MODULE_NAME == 'Urlrule') {
         if (APP_LANG) {
             $l = get_safe_replace($_REQUEST['l']);
             $lang = $l ? '_' . $l : '_' . C('DEFAULT_LANG');
         }
         $catdir = get_safe_replace($_REQUEST['catdir']);
         if ($catdir) {
             $Cat = F('Cat' . $lang);
             $catid = $catid ? $catid : $Cat[$catdir];
             unset($Cat);
         }
         if ($_REQUEST['module']) {
             $m = get_safe_replace($_REQUEST['module']);
         } elseif ($moduleid) {
             $Module = F('Module');
             $m = $Module[$moduleid]['module'];
             unset($Module);
         } elseif ($catid) {
             $Category = F('Category' . $lang);
             $m = $Category[$catid]['module'];
             unset($Category);
         } else {
             throw_exception('404');
         }
         if ($a == 'index') {
             $id = $catid;
         }
     } else {
         if (empty($id)) {
             $Cat = F('Cat' . $lang);
             $id = $Cat[$id];
             unset($Cat);
         }
         $m = MODULE_NAME;
     }
     import('@.Action.Base');
     $bae = new BaseAction();
     if (!method_exists($bae, $a)) {
         throw_exception('404');
     }
     $bae->{$a}($id, $m);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:55,代码来源:EmptyAction.class.php

示例4: downloadxls

 public function downloadxls()
 {
     $where = 1;
     $name = "全部订单:" . time();
     if ($_REQUEST["time1"] || $_REQUEST["time2"]) {
         $time1 = get_safe_replace($_REQUEST["time1"]);
         $time2 = get_safe_replace($_REQUEST["time2"]);
         /*strtotime($time2)-($day*86400);*/
         if ($time1 == $time2) {
             $time1 = strtotime($time1) - 86400;
         } else {
             $time1 = strtotime($time1);
         }
         /*相同日期则选择一天*/
         $where .= " and add_time > '" . $time1 . "' and add_time < '" . strtotime($time2) . "'";
         $name = "时间段" . toDate($time1, "Y/m/d") . "-" . toDate(strtotime($time2), "Y/m/d");
     }
     $order = M(MODULE_NAME)->where($where)->getfield('id,sn,add_time,consignee,mobile,order_amount,province,city,area,address');
     //
     $data = array();
     foreach ($order as $key => $vv) {
         $oid .= $key == 0 ? $vv['id'] : ',' . $vv['id'];
     }
     if (empty($oid)) {
         $this->success('数据为空!');
         exit;
     }
     $od['order_id'] = array('in', $oid);
     $order_data = M("order_data")->where($od)->select();
     $area = M('area')->getfield('id,name');
     foreach ($order_data as $key => $v) {
         $data[$key][1] = $order[$v['order_id']]['sn'] . "号";
         $data[$key][2] = toDate($order[$v['order_id']]["add_time"], "Y/m/d H:i:s");
         $data[$key][3] = $v['product_name'];
         $data[$key][4] = $v['type_name'];
         $data[$key][5] = $order[$v['order_id']]["pay_status"] == 2 ? '已支付' : '未支付';
         $data[$key][6] = $order[$v['order_id']]["order_amount"] . "元";
         $data[$key][7] = $order[$v['order_id']]["consignee"];
         $data[$key][8] = $order[$v['order_id']]["mobile"];
         $data[$key][9] = $area[$order[$v['order_id']]["province"]];
         $data[$key][10] = $area[$order[$v['order_id']]["city"]];
         $data[$key][11] = $area[$order[$v['order_id']]["area"]];
         $data[$key][12] = $order[$v['order_id']]["address"];
     }
     $title = array(1 => "订单编号", 2 => "订单时间", 3 => "订购产品", 4 => "订购类型", 5 => "支付状态", 6 => "订单价格", 7 => "姓名", 8 => "手机", 9 => "省份", 10 => "城市", 11 => "区域", 12 => "地址");
     $this->exportexcel($data, $title, $name);
 }
开发者ID:anywn3773,项目名称:bydproject,代码行数:47,代码来源:OrderAction.class.php

示例5: _initialize

 function _initialize()
 {
     parent::_initialize();
     if (!$this->_userid) {
         $this->assign('jumpUrl', U('User/Login/index'));
         $this->error(L('nologin'));
         exit;
     }
     $this->dao = M('User');
     $this->assign('bcid', 0);
     $user = $this->dao->find($this->_userid);
     $this->assign('vo', $user);
     unset($_POST['status']);
     unset($_POST['groupid']);
     unset($_POST['amount']);
     unset($_POST['point']);
     $_GET = get_safe_replace($_GET);
 }
开发者ID:JavaAFei,项目名称:yun001,代码行数:18,代码来源:IndexAction.class.php

示例6: downloadxls

 public function downloadxls()
 {
     $where = 1;
     $name = "全部订单:" . time();
     if ($_REQUEST["time1"] || $_REQUEST["time2"]) {
         $time1 = get_safe_replace($_REQUEST["time1"]);
         $time2 = get_safe_replace($_REQUEST["time2"]);
         /*strtotime($time2)-($day*86400);*/
         if ($time1 == $time2) {
             $time1 = strtotime($time1) - 86400;
         } else {
             $time1 = strtotime($time1);
         }
         /*相同日期则选择一天*/
         $where .= " and createtime > '" . $time1 . "' and createtime < '" . strtotime($time2) . "'";
         $name = "预约试驾" . toDate($time1, "Y/m/d") . "-" . toDate(strtotime($time2), "Y/m/d");
     }
     $area = M('area')->getfield('id,name');
     $bill = M(MODULE_NAME)->where($where)->select();
     foreach ($bill as $key => $vo) {
         $pro = M("product")->where('id=' . $vo['car_name'])->cache(true)->find();
         $data[$key][1] = $vo['id'];
         $data[$key][2] = $pro['title'];
         $data[$key][3] = toDate($vo['datetime'], "Y/m/d");
         $data[$key][4] = $vo['username'];
         $data[$key][5] = $vo['sex'] == 1 ? "先生" : '女士';
         if ($vo['sex'] == 0) {
             $data[$key][5] = '未知';
         }
         $data[$key][6] = '手机' . $vo['mobile'];
         $data[$key][7] = $area[$vo['province']];
         $data[$key][8] = $area[$vo['city']];
         $data[$key][9] = $area[$vo['area']];
         $shopname = M("shop")->where('shopcode=\'' . $vo['shop_name'] . '\'')->getfield('sname');
         if (!$shopname) {
             $shopname = "客户未选择";
         }
         $data[$key][10] = $shopname;
     }
     $title = array(1 => "预约号", 2 => "预约车型", 3 => "预约时间", 4 => "预约人", 5 => "性别", 6 => "电话", 7 => "省份", 8 => "城市", 9 => "区域", 10 => "经销商");
     $order = A('Admin/Order');
     $order->exportexcel($data, $title, $name);
 }
开发者ID:anywn3773,项目名称:bydproject,代码行数:43,代码来源:BillAction.class.php

示例7: order

 public function order()
 {
     $uid = intval($_REQUEST['uid']);
     $this->assign('uid', $uid);
     $mid = intval($_REQUEST['id']);
     $mx = get_safe_replace($_REQUEST['mx']);
     if ($mid > 0 && strlen($mx) > 0) {
         $pro = M($mx)->where("id=" . $mid)->find();
     }
     if ($this->Config["wap"] && is_mobile()) {
         /*开启手机访问*/
         $tmp = THEME_PATH . "wap/Index_order.html";
     }
     $this->assign('mx', $mx);
     $this->assign('mid', $mid);
     $this->assign('order', $pro);
     print_r($user);
     $this->display($tmp);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:19,代码来源:IndexAction.class.php

示例8: respond

 public function respond()
 {
     $pay_code = !empty($_REQUEST['code']) ? get_safe_replace($_REQUEST['code']) : '';
     $pay_code = ucfirst($pay_code);
     $Payment = M('Payment')->getByPayCode($pay_code);
     if (empty($Payment)) {
         $this->error(L('PAY CODE EROOR!'));
     }
     $aliapy_config = unserialize($Payment['pay_config']);
     import("@.Pay." . $pay_code);
     $pay = new $pay_code($aliapy_config);
     $r = $pay->respond();
     $this->assign('jumpUrl', URL('User-Order/index'));
     if ($r) {
         $this->error(L('PAY_OK'));
     } else {
         $this->error(L('PAY_FAIL'));
     }
 }
开发者ID:yunsite,项目名称:yourphpcms,代码行数:19,代码来源:PayAction.class.php

示例9: respond

 public function respond()
 {
     if (!empty($_POST)) {
         foreach ($_POST as $key => $data) {
             $_GET[$key] = $data;
         }
     }
     $seller_email = rawurldecode($_GET['seller_email']);
     //$order_sn = str_replace($_GET['subject'], '', $_GET['out_trade_no']);
     $order_sn = trim($_GET['out_trade_no']);
     $record = intval($_GET['record']);
     $total_fee = get_safe_replace($_GET['total_fee']);
     /* 检查数字签名是否正确 */
     ksort($_GET);
     reset($_GET);
     $sign = '';
     foreach ($_GET as $key => $val) {
         if ($key != 'sign' && $key != 'sign_type' && $key != 'code' && $key != 'g' && $key != 'm' && $key != 'a' && $key != 'record') {
             $sign .= "{$key}={$val}&";
         }
     }
     $sign = substr($sign, 0, -1) . $this->config['alipay_key'];
     //$sign = substr($sign, 0, -1) . ALIPAY_AUTH;
     if (md5($sign) != $_GET['sign']) {
         return false;
     }
     if ($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS' || $_GET['trade_status'] == 'WAIT_BUYER_CONFIRM_GOODS' || $_GET['trade_status'] == 'WAIT_BUYER_PAY') {
         /* 改变订单状态 进行中*/
         return order_pay_status($order_sn, '1', $total_fee, $record);
     } elseif ($_GET['trade_status'] == 'TRADE_FINISHED') {
         /* 改变订单状态 */
         return order_pay_status($order_sn, '2', $total_fee, $record);
     } elseif ($_GET['trade_status'] == 'TRADE_SUCCESS') {
         /* 改变订单状态 即时交易成功*/
         return order_pay_status($order_sn, '2', $total_fee, $record);
     } else {
         return false;
     }
 }
开发者ID:bossyuetao,项目名称:yuephp,代码行数:39,代码来源:Alipay.class.php

示例10: downloadxls

 public function downloadxls()
 {
     $where = 1;
     $name = "全部订单:" . time();
     if ($_REQUEST["time1"] || $_REQUEST["time2"]) {
         $time1 = get_safe_replace($_REQUEST["time1"]);
         $time2 = get_safe_replace($_REQUEST["time2"]);
         /*strtotime($time2)-($day*86400);*/
         if ($time1 == $time2) {
             $time1 = strtotime($time1) - 86400;
         } else {
             $time1 = strtotime($time1);
         }
         /*相同日期则选择一天*/
         $where .= " and createtime > '" . $time1 . "' and createtime < '" . strtotime($time2) . "'";
         $name = "时间段" . toDate($time1, "Y/m/d") . "-" . toDate(strtotime($time2), "Y/m/d");
     }
     $order = M(MODULE_NAME)->where($where)->getfield('id,username,realname,createtime,username,username,username,username');
     //
     $title = array(1 => "订单编号", 2 => "订单时间", 3 => "订购产品", 4 => "订购类型", 5 => "支付状态", 6 => "订单价格", 7 => "姓名", 8 => "手机", 9 => "省份", 10 => "城市", 11 => "区域", 12 => "地址");
     $order = A('Order');
     $order->exportexcel($data, $title, $name);
 }
开发者ID:anywn3773,项目名称:bydproject,代码行数:23,代码来源:UserAction.class.php

示例11: sendmail

 function sendmail()
 {
     $verifyCode = trim($_POST['verifyCode']);
     $username = get_safe_replace($_POST['username']);
     $email = get_safe_replace($_POST['email']);
     if (empty($username) || empty($email)) {
         $this->error(L('empty_username_empty_password'));
     } elseif (md5($verifyCode) != $_SESSION['verify']) {
         $this->error(L('error_verify'));
     }
     $user = M('User');
     //判断邮箱是用户是否正确
     $data = $user->where("username='{$username}' and email='{$email}'")->find();
     if ($data) {
         $yourphp_auth = authcode($data['id'] . "-" . $data['username'] . "-" . $data['email'], 'ENCODE', $this->sysConfig['ADMIN_ACCESS'], 3600 * 24 * 3);
         //3天有效期
         $username = $data['username'];
         $url = 'http://' . $_SERVER['HTTP_HOST'] . U('User/Login/repassword?code=' . $yourphp_auth);
         $message = str_replace(array('{username}', '{url}', '{sitename}'), array($username, $url, $this->Config['site_name']), $this->member_config['member_getpwdemaitpl']);
         $r = sendmail($email, L('USER_FORGOT_PASSWORD') . '-' . $this->Config['site_name'], $message, $this->Config);
         if ($r) {
             $returndata['username'] = $data['username'];
             $returndata['email'] = $data['email'];
             $this->ajaxReturn($returndata, L('USER_EMAIL_ERROR'), 1);
         } else {
             $this->ajaxReturn(0, L('SENDMAIL_ERROR'), 0);
         }
     } else {
         $this->ajaxReturn(0, L('USER_EMAIL_ERROR'), 0);
     }
     //$this->ajaxReturn(1,L('login_ok'),1);
 }
开发者ID:JavaAFei,项目名称:yun001,代码行数:32,代码来源:LoginAction.class.php

示例12: editup

 public function editup()
 {
     $_REQUEST = get_safe_replace($_REQUEST);
     $menuname = $_REQUEST["menuname"];
     $key = $_REQUEST["key"];
     $url = $_REQUEST["url"];
     $type = $_REQUEST["type"];
     $fatherid = intval($_REQUEST["fatherid"]);
     if (empty($menuname)) {
         $info = "菜单名字不可为空!";
         $this->ajaxreturn($data, $info, 0);
     }
     if ($type == "view") {
         $map["url"] = $url;
         if (empty($url)) {
             $info = "连接不可为空!";
             $this->ajaxreturn($data, $info, 0);
         }
     } else {
         $map["key"] = $key;
         if (empty($key)) {
             $info = "关键词不可为空!";
             $this->ajaxreturn($data, $info, 0);
         }
     }
     $map["menuname"] = $menuname;
     $map["type"] = $type;
     $r = M("wxmenu")->where("id=" . $fatherid)->save($map);
     if ($r) {
         $info = "修改成功";
         $this->ajaxreturn($data, $info, 1);
     } else {
         $info = "{$menuname}:{$key}:{$url}:{$type}";
         $this->ajaxreturn($data, $info, 0);
     }
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:36,代码来源:WxmenuAction.class.php

示例13: get_safe_replace

function get_safe_replace($array)
{
    if (!is_array($array)) {
        return safe_replace(strip_tags($array));
    }
    foreach ($array as $k => $val) {
        $array[$k] = get_safe_replace($val);
    }
    return $array;
}
开发者ID:JavaAFei,项目名称:yun001,代码行数:10,代码来源:~runtime.php

示例14: verify

 public function verify()
 {
     header('Content-type: image/jpeg');
     $type = isset($_GET['type']) ? get_safe_replace($_GET['type']) : 'jpeg';
     import("@.EXT.Image");
     Image::buildImageVerify(4, 1, $type);
 }
开发者ID:bossyuetao,项目名称:yuephp,代码行数:7,代码来源:AdminbaseAction.class.php

示例15: downloadxls

 public function downloadxls()
 {
     // $list=$this->_list(MODULE_NAME);
     $where = 1;
     $name = "全部订单:" . time();
     if (intval($_REQUEST["uid"])) {
         $where .= " and userid=" . intval($_REQUEST["uid"]);
         $name = "用户" . intval($_REQUEST["uid"]);
     }
     if (intval($_REQUEST["mid"])) {
         $where .= " and mid=" . intval($_REQUEST["mid"]);
     }
     if ($_REQUEST["mx"]) {
         $where .= " and mx='" . get_safe_replace($_REQUEST["mx"]) . "'";
         $name = get_safe_replace($_REQUEST["mx"]) . intval($_REQUEST["uid"]);
     }
     if ($_REQUEST["mb"]) {
         $where .= " and mobile='" . get_safe_replace($_REQUEST["mb"]) . "'";
         $name = "手机" . get_safe_replace($_REQUEST["mb"]);
     }
     $udata = M(MODULE_NAME)->where($where)->select();
     $data = array();
     foreach ($udata as $key => $v) {
         $data[$key][1] = $key;
         $data[$key][2] = $v["username"];
         $data[$key][3] = $v["mobile"];
         $data[$key][4] = str_cut($v["title"], 20, "");
         $data[$key][5] = $v["mcount"];
         $data[$key][6] = $v["amount"];
         $data[$key][7] = $v["godate"];
         $data[$key][8] = toDate($v["add_time"], "Y/m/d H:i:s");
     }
     $title = array(1 => "订单编号", 2 => "姓名", 3 => "手机", 4 => "线路", 5 => "数量", 6 => "总价格", 7 => "出发时间", 8 => "添加时间");
     $this->exportexcel($data, $title, $name);
 }
开发者ID:anywn3773,项目名称:gzsrex,代码行数:35,代码来源:PiaoorderAction.class.php


注:本文中的get_safe_replace函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。