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


PHP String::htmlspecialchars方法代码示例

本文整理汇总了PHP中String::htmlspecialchars方法的典型用法代码示例。如果您正苦于以下问题:PHP String::htmlspecialchars方法的具体用法?PHP String::htmlspecialchars怎么用?PHP String::htmlspecialchars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在String的用法示例。


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

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     $this->s_db = Loader::model('poster_space_model');
     $this->db = Loader::model('poster_model');
     $this->M = String::htmlspecialchars(S('common/poster'));
 }
开发者ID:hubs,项目名称:yuncms,代码行数:7,代码来源:PosterController.php

示例2: register

 /**
  * 申请友情链接
  */
 public function register()
 {
     if (isset($_POST['dosubmit'])) {
         if ($_POST['name'] == "") {
             showmessage(L('sitename_noempty'), U('link/index/register'));
         }
         if ($_POST['url'] == "") {
             showmessage(L('siteurl_not_empty'), U('link/index/register'));
         }
         if (!in_array($_POST['linktype'], array('0', '1'))) {
             $_POST['linktype'] = '0';
         }
         $link_db = Loader::model('link_model');
         $_POST['logo'] = String::htmlspecialchars($_POST['logo']);
         if ($_POST['linktype'] == '0') {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
         } else {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
         }
         $link_db->insert($sql);
         showmessage(L('add_success'), U('link/index'));
     } else {
         $setting = S('common/link');
         if (isset($setting['is_post']) && $setting['is_post'] == '0') {
             showmessage(L('suspend_application'), HTTP_REFERER);
         }
         $this->type = Loader::model('type_model');
         $types = $this->type->get_types();
         // 获取站点下所有友情链接分类
         $SEO = seo('', L('application_links'), '', '');
         include template('link', 'register');
     }
 }
开发者ID:hubs,项目名称:yuncms,代码行数:36,代码来源:IndexController.php

示例3: encode

 public function encode($text, $textType = "")
 {
     if (is_object($text)) {
         return $text;
     }
     return String::htmlspecialchars($text);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:7,代码来源:xmlconverter.php

示例4: type_lists

 /**
  * 首页 友情链接分类 循环 .
  *
  * @param
  *        	$data
  */
 public function type_lists($data)
 {
     if (!in_array($data['listorder'], array('desc', 'asc'))) {
         $data['listorder'] = 'desc';
     }
     $sql = array('application' => APP);
     $r = $this->type_db->where($sql)->order('listorder ' . $data['listorder'])->limit($data['limit'])->select();
     return String::htmlspecialchars($r);
 }
开发者ID:hubs,项目名称:yuncms,代码行数:15,代码来源:link_tag.php

示例5: encode

 public function encode($text, $textType = "")
 {
     if (is_object($text)) {
         return $text;
     }
     $textType = Converter::initTextType($textType);
     if ($textType == Converter::HTML) {
         return $text;
     }
     return String::htmlspecialchars($text);
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:11,代码来源:htmlconverter.php

示例6: init

 public function init()
 {
     if (isset($_GET['typeid'])) {
         $where = array('typeid' => intval($_GET['typeid']));
     } else {
         $where = array();
     }
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $infos = $this->db->where($where)->order('listorder DESC,linkid DESC')->listinfo($page, 15);
     $pages = $this->db->pages;
     $types = $this->db2->where(array('application' => APP))->order('typeid DESC')->listinfo();
     $types = String::htmlspecialchars($types);
     $type_arr = array();
     foreach ($types as $typeid => $type) {
         $type_arr[$type['typeid']] = $type['name'];
     }
     $big_menu = big_menu('?app=link&controller=link&action=add', 'add', L('link_add'), 700, 450);
     include $this->view('link_list');
 }
开发者ID:hubs,项目名称:yuncms,代码行数:19,代码来源:LinkController.php

示例7: read_group

 /**
  * 查看系统短消息
  */
 public function read_group()
 {
     if ((!isset($_GET['group_id']) || empty($_GET['group_id'])) && (!isset($_POST['group_id']) || empty($_POST['group_id']))) {
         return false;
     }
     // 查询消息详情
     $infos = $this->message_group_db->getby_id($_GET['group_id']);
     $infos = String::htmlspecialchars($infos);
     if (!is_array($infos)) {
         showmessage(L('message_not_exist'), 'blank');
     }
     // 检查查看表是否有记录,无则向message_data 插入浏览记录
     $check = $this->message_data_db->where(array('userid' => $this->_userid, 'group_message_id' => $_GET['group_id']))->select();
     if (!$check) {
         $this->message_data_db->insert(array('userid' => $this->_userid, 'group_message_id' => $_GET['group_id']));
     }
     include template('message', 'read_group');
 }
开发者ID:hubs,项目名称:yuncms,代码行数:21,代码来源:IndexController.php

示例8: show_stat

 /**
  * 统计广告展示次数
  *
  * @param intval $spaceid 广告版位ID
  * @param intval $id 广告ID
  * @return boolen
  */
 protected function show_stat($spaceid = 0, $id = 0)
 {
     $M = String::htmlspecialchars(S('common/poster'));
     if ($M['enablehits'] == 0) {
         return true;
     }
     $spaceid = intval($spaceid);
     $id = intval($id);
     if (!$id) {
         return false;
     }
     if (!$spaceid) {
         $r = $this->db->where(array('id' => $id))->field('spaceid')->find();
         $spaceid = $r['spaceid'];
     }
     $ip = IP;
     $ip_area = Loader::lib('lib/lib_ip');
     $area = $ip_area->get($ip);
     $username = cookie('username') ? cookie('username') : '';
     $this->db->where(array('id' => $id))->update(array('hits' => '+1'));
     $this->s_db->insert(array('pid' => $id, 'spaceid' => $spaceid, 'username' => $username, 'area' => $area, 'ip' => $ip, 'referer' => HTTP_REFERER, 'clicktime' => TIME, 'type' => 0));
     return true;
 }
开发者ID:hubs,项目名称:yuncms,代码行数:30,代码来源:IndexController.php


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