當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。