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


PHP new_addslashes函数代码示例

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


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

示例1: add

 function add()
 {
     if ($_POST['dosubmit']) {
         $siteid = intval($_POST['siteid']) ? intval($_POST['siteid']) : showmessage(L('parameter_error'), HTTP_REFERER);
         if ($this->db->get_one(array('siteid' => $siteid))) {
             showmessage(L('wap_add_samesite_error'), HTTP_REFERER);
         }
         $sitename = trim(new_addslashes($_POST['sitename']));
         $logo = trim($_POST['logo']);
         $domain = trim($_POST['domain']);
         $setting = array2string($_POST['setting']);
         $return_id = $this->db->insert(array('siteid' => $siteid, 'sitename' => $sitename, 'logo' => $logo, 'domain' => $domain, 'setting' => $setting), '1');
         $this->wap_site_cache();
         showmessage(L('operation_success'), '', '', 'add');
     } else {
         $sitelists = array();
         $current_siteid = get_siteid();
         $sitelists = $this->sites->get_list();
         if ($_SESSION['roleid'] == '1') {
             foreach ($sitelists as $key => $v) {
                 $sitelist[$key] = $v['name'];
             }
         } else {
             $sitelist[$current_siteid] = $sitelists[$current_siteid]['name'];
         }
         $show_header = true;
         include $this->admin_tpl('m_add');
     }
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:29,代码来源:wap_admin.php

示例2: __construct

 public function __construct()
 {
     if (!get_magic_quotes_gpc()) {
         $_POST = new_addslashes($_POST);
         $_GET = new_addslashes($_GET);
         $_REQUEST = new_addslashes($_REQUEST);
         $_COOKIE = new_addslashes($_COOKIE);
     }
     $this->route_config = pc_base::load_config('route', SITE_URL) ? pc_base::load_config('route', SITE_URL) : pc_base::load_config('route', 'default');
     if (isset($this->route_config['data']['POST']) && is_array($this->route_config['data']['POST'])) {
         foreach ($this->route_config['data']['POST'] as $_key => $_value) {
             if (!isset($_POST[$_key])) {
                 $_POST[$_key] = $_value;
             }
         }
     }
     if (isset($this->route_config['data']['GET']) && is_array($this->route_config['data']['GET'])) {
         foreach ($this->route_config['data']['GET'] as $_key => $_value) {
             if (!isset($_GET[$_key])) {
                 $_GET[$_key] = $_value;
             }
         }
     }
     if (isset($_GET['page'])) {
         $_GET['page'] = max(intval($_GET['page']), 1);
     }
     return true;
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:28,代码来源:param.class.php

示例3: EditConfig

function EditConfig($file = '', $name = '', $value = '', $daxiao = 'xiao')
{
    static $content = array();
    if (!isset($content[$file])) {
        $content[$file] = file_get_contents(G_CONFIG . $file . '.inc.php');
        if (!is_writable(G_CONFIG . $file . '.inc.php')) {
            _message('Please chmod  "' . $file . '"  to 0777 !');
        }
    }
    if (empty($name)) {
        return false;
    }
    if ($daxiao == 'xiao') {
        $value = strtolower(new_addslashes($value));
    }
    if ($daxiao == 'da') {
        $value = strtoupper(new_addslashes($value));
    }
    if ($daxiao == 'no') {
        $value = new_addslashes($value);
    }
    $pat = "/\\'{$name}\\'\\s*=>\\s*([']?)[^']*([']?)(\\s*),/is";
    $content[$file] = preg_replace($pat, "'{$name}' => \${1}" . $value . "\${2}\${3},", $content[$file]);
    file_put_contents(G_CONFIG . $file . '.inc.php', $content[$file]);
}
开发者ID:king3388,项目名称:king,代码行数:25,代码来源:global.fun.php

示例4: add

 public function add()
 {
     if (isset($_POST['dosubmit'])) {
         $_POST['link']['addtime'] = SYS_TIME;
         $_POST['link']['siteid'] = $this->get_siteid();
         if (empty($_POST['link']['name'])) {
             showmessage(L('sitename_noempty'), HTTP_REFERER);
         } else {
             $_POST['link']['name'] = safe_replace($_POST['link']['name']);
         }
         if ($_POST['link']['logo']) {
             $_POST['link']['logo'] = safe_replace($_POST['link']['logo']);
         }
         $data = new_addslashes($_POST['link']);
         $linkid = $this->db->insert($data, true);
         if (!$linkid) {
             return FALSE;
         }
         $siteid = $this->get_siteid();
         //更新附件状态
         if (pc_base::load_config('system', 'attachment_stat') & $_POST['link']['logo']) {
             $this->attachment_db = pc_base::load_model('attachment_model');
             $this->attachment_db->api_update($_POST['link']['logo'], 'link-' . $linkid, 1);
         }
         showmessage(L('operation_success'), HTTP_REFERER, '', 'add');
     } else {
         $show_validator = $show_scroll = $show_header = true;
         pc_base::load_sys_class('form', '', 0);
         $siteid = $this->get_siteid();
         $types = $this->db2->get_types($siteid);
         //print_r($types);exit;
         include $this->admin_tpl('link_add');
     }
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:34,代码来源:link.php

示例5: _initialize

 function _initialize()
 {
     //参数转义
     new_addslashes($_POST);
     new_addslashes($_GET);
     //设置心情Action的数据处理层
     $this->name = $this->my_name;
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:8,代码来源:IndexAction.class.php

示例6: _initialize

 public function _initialize()
 {
     //参数转义
     new_addslashes($_POST);
     new_addslashes($_GET);
     $_POST = $this->__filterLabel($_POST);
     parent::_initialize();
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:8,代码来源:InfoAction.class.php

示例7: _initialize

 /**
  * __initialize
  * 初始化
  * @access public
  * @return void
  */
 public function _initialize()
 {
     //参数转义
     new_addslashes($_POST);
     new_addslashes($_GET);
     //设置心情Action的数据处理层
     $this->blog = D('Blog');
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:14,代码来源:ActiveAction.class.php

示例8: _initialize

 /**
  * __initialize
  * 初始化
  * @access public
  * @return void
  */
 public function _initialize()
 {
     //参数转义
     new_addslashes($_POST);
     new_addslashes($_GET);
     //设置心情Action的数据处理层
     $this->event = D('Event');
     $this->event->setApi($this->api);
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:15,代码来源:IndexAction.class.php

示例9: new_addslashes

/**
 * 返回经addslashes处理过的字符串或数组
 * @param $string 需要处理的字符串或数组
 * @return mixed
 */
function new_addslashes($string)
{
    if (!is_array($string)) {
        return addslashes($string);
    }
    foreach ($string as $key => $val) {
        $string[$key] = new_addslashes($val);
    }
    return $string;
}
开发者ID:hw18708118867,项目名称:htmlmoban,代码行数:15,代码来源:global.func.php

示例10: new_addslashes

function new_addslashes($str)
{
    if (!is_array($str)) {
        return addslashes($str);
    }
    foreach ($str as $key => $val) {
        $str[$key] = new_addslashes($val);
    }
    return $str;
}
开发者ID:iquanxin,项目名称:march,代码行数:10,代码来源:global.func.php

示例11: api_add

	public function api_add($uploadedfile) {
		$uploadfield = array();
		$uploadfield = $uploadedfile;
		unset($uploadfield['fn']);
		$uploadfield = new_addslashes($uploadfield);
		$this->insert($uploadfield);
		$aid = $this->insert_id();
		$uploadedfile['aid'] = $aid;
		return $aid;
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:10,代码来源:attachment_model.class.php

示例12: __construct

 public function __construct()
 {
     if (!get_magic_quotes_gpc()) {
         $_GET = new_addslashes($_GET);
         $_POST = new_addslashes($_POST);
         $_REQUEST = new_addslashes($_REQUEST);
         $_COOKIE = new_addslashes($_COOKIE);
     }
     $this->route = loadConfig('route', 'default');
     if (isset($_GET['page'])) {
         $_GET['page'] = max(intval($_GET['page']), 1);
         $_GET['page'] = min($_GET['page'], 1000000);
     }
 }
开发者ID:iquanxin,项目名称:march,代码行数:14,代码来源:param.cls.php

示例13: new_addslashes

function new_addslashes($string)
{
    if (!get_magic_quotes_gpc()) {
        if (!is_array($string)) {
            return addslashes(trim($string));
        }
        foreach ($string as $key => $val) {
            $string[$key] = new_addslashes($val);
        }
        return $string;
    } else {
        return $string;
    }
}
开发者ID:vangogogo,项目名称:justsns,代码行数:14,代码来源:Ts_common.php

示例14: __construct

 /**
  * 构造函数
  */
 public function __construct()
 {
     $this->db = pc_base::load_model('member_model');
     pc_base::load_app_func('global');
     /*获取系统配置*/
     $this->settings = getcache('settings', 'admin');
     $this->applist = getcache('applist', 'admin');
     if (isset($_GET) && is_array($_GET) && count($_GET) > 0) {
         foreach ($_GET as $k => $v) {
             if (!in_array($k, array('m', 'c', 'a'))) {
                 $_POST[$k] = $v;
             }
         }
     }
     if (isset($_POST['appid'])) {
         $this->appid = intval($_POST['appid']);
     } else {
         exit('0');
     }
     if (isset($_POST['data'])) {
         parse_str(sys_auth($_POST['data'], 'DECODE', $this->applist[$this->appid]['authkey']), $this->data);
         if (empty($this->data) || !is_array($this->data)) {
             exit('0');
         }
         if (!get_magic_quotes_gpc()) {
             $this->data = new_addslashes($this->data);
         }
         if (isset($this->data['username']) && $this->data['username'] != '' && is_username($this->data['username']) == false) {
             exit('-5');
         }
         if (isset($this->data['email']) && $this->data['username'] != '' && is_email($this->data['email']) == false) {
             exit('-5');
         }
         if (isset($this->data['password']) && $this->data['password'] != '' && (is_password($this->data['password']) == false || is_badword($this->data['password']))) {
             exit('-5');
         }
         if (isset($this->data['newpassword']) && $this->data['newpassword'] != '' && (is_password($this->data['newpassword']) == false || is_badword($this->data['newpassword']))) {
             exit('-5');
         }
     } else {
         exit('0');
     }
     if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
         $this->data['avatardata'] = $GLOBALS['HTTP_RAW_POST_DATA'];
         //if($this->applist[$this->appid]['authkey'] != $this->data['ps_auth_key']) {
         //	exit('0');
         //}
     }
 }
开发者ID:boylzj,项目名称:omguitar,代码行数:52,代码来源:phpsso.class.php

示例15: _initialize

 /**
  * 初始化函数
  *
  */
 function _initialize()
 {
     //参数转义
     new_addslashes($_POST);
     new_addslashes($_GET);
     //整个应用的赋值
     $this->gift = D('Gift');
     $this->gift_category = D('GiftCategory');
     $this->user_gift = D('UserGift');
     $this->user_gift->setApi($this->api);
     $this->user_gift->setGift($this->gift);
     $this->user_gift->setCategory($this->gift_category);
     $this->gift_category->setGift($this->gift);
     $mid = $this->mid;
     $config = D('AppConfig')->getConfig();
     $this->assign('config', $config);
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:21,代码来源:IndexAction.class.php


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