本文整理汇总了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');
}
}
示例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;
}
示例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]);
}
示例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');
}
}
示例5: _initialize
function _initialize()
{
//参数转义
new_addslashes($_POST);
new_addslashes($_GET);
//设置心情Action的数据处理层
$this->name = $this->my_name;
}
示例6: _initialize
public function _initialize()
{
//参数转义
new_addslashes($_POST);
new_addslashes($_GET);
$_POST = $this->__filterLabel($_POST);
parent::_initialize();
}
示例7: _initialize
/**
* __initialize
* 初始化
* @access public
* @return void
*/
public function _initialize()
{
//参数转义
new_addslashes($_POST);
new_addslashes($_GET);
//设置心情Action的数据处理层
$this->blog = D('Blog');
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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');
//}
}
}
示例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);
}