侯体宗的博客
  • 首页
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

一款简单实用的php操作mysql数据库类

php  /  管理员 发布于 7年前   204

本文实例讲述了一款简单实用的php操作mysql数据库类。分享给大家供大家参考。具体如下:

复制代码 代码如下:

/*
本款数据库连接类,他会自动加载sql防注入功能,过滤一些敏感的sql查询关键词,同时还可以增加判断字段 show table status的性质与show table类 获取数据库所有表名等。*/
@ini_set('mysql.trace_mode','off');
class mysql
{
 public $dblink;
 public $pconnect;
 private $search = array('/union(s*(/*.**/)?s*)+select/i', '/load_file(s*(/*.**/)?s*)+(/i', '/into(s*(/*.**/)?s*)+outfile/i');
 private $replace = array('union   select', 'load_file   (', 'into   outfile');
 private $rs;
 
 function __construct($hostname,$username,$userpwd,$database,$pconnect=false,$charset='utf8')
 {
  define('allowed_htmltags', '<meta><body><p><br><hr><h1><h2><h3><h4><h5><h6><font><u><i><b><strong><span><ol><ul><li><table><tr><td><map>');  <br>  $this->pconnect=$pconnect; <br>  $this->dblink=$pconnect?mysql_pconnect($hostname,$username,$userpwd):mysql_connect($hostname,$username,$userpwd); <br>  (!$this->dblink||!is_resource($this->dblink)) && fatal_error("connect to the database unsuccessfully!"); <br>  @mysql_unbuffered_query("set names {$charset}"); <br>  if($this->version()>'5.0.1') <br>  { <br>   @mysql_unbuffered_query("set sql_mode = ''"); <br>  } <br>  @mysql_select_db($database) or fatal_error("can not select table!"); <br>  return $this->dblink; <br> } <br> <br> function query($sql,$unbuffered=false) <br> { <br>  //echo $sql.'<br>'; <br>  $this->rs=$unbuffered?mysql_unbuffered_query($sql,$this->dblink):mysql_query($sql,$this->dblink); <br>  //(!$this->rs||!is_resource($this->rs)) && fatal_error("execute the query unsuccessfully! error:".mysql_error()); <br>  if(!$this->rs)fatal_error('在执行sql语句 '.$sql.' 时发生以下错误:'.mysql_error()); <br>  return $this->rs; <br> } <br> <br> function fetch_one($sql) <br> { <br>  $this->rs=$this->query($sql); <br>  return dircms_strips教程lashes($this->filter_pass(mysql_fetch_array($this->rs,mysql_assoc))); <br> } <br> <br> function get_maxfield($filed='id',$table) // 获取$table表中$filed字段的最大值 <br> { <br>  $r=$this->fetch_one("select {$table}.{$filed} from `{$table}` order by `{$table}`.`{$filed}` desc limit 0,1"); <br>  return $r[$filed]; <br> } <br> <br> function fetch_all($sql) <br> { <br>  $this->rs=$this->query($sql); <br>  $result=array(); <br>  while($rows=mysql_fetch_array($this->rs,mysql_assoc)) <br>  { <br>   $result[]=$rows; <br>  } <br>   <br>  mysql_free_result($this->rs); <br>  return dircms_stripslashes($this->filter_pass($result));  <br> } <br> <br> function fetch_all_withkey($sql,$key='id') <br> { <br>  $this->rs=$this->query($sql); <br>  $result=array(); <br>  while($rows=mysql_fetch_array($this->rs,mysql_assoc)) <br>  { <br>   $result[$rows[$key]]=$rows; <br>  } <br>   <br>  mysql_free_result($this->rs); <br>  return dircms_stripslashes($this->filter_pass($result));  <br> } <br> <br> function last_insert_id() <br> { <br>  if(($insertid=mysql_insert_id($this->dblink))>0)return $insertid; <br>  else //如果 auto_increment 的列的类型是 bigint,则 mysql_insert_id() 返回的值将不正确. <br>  { <br>   $result=$this->fetch_one('select last_insert_id() as insertid'); <br>   return $result['insertid']; <br>  } <br> } <br> <br> function insert($tbname,$varray,$replace=false) <br> { <br>  $varray=$this->escape($varray); <br>  $tb_fields=$this->get_fields($tbname); // 升级一下,增加判断字段是否存在 <br>   <br>  foreach($varray as $key => $value) <br>  { <br>   if(in_array($key,$tb_fields)) <br>   { <br>    $fileds[]='`'.$key.'`'; <br>    $values[]=is_string($value)?'''.$value.''':$value; <br>   } <br>  } <br> <br>  if($fileds) <br>  { <br>   $fileds=implode(',',$fileds); <br>   $fileds=str_replace(''','`',$fileds); <br>   $values=implode(',',$values); <br>   $sql=$replace?"replace into {$tbname}({$fileds}) values ({$values})":"insert into {$tbname}({$fileds}) values ({$values})"; <br>   $this->query($sql,true); <br>   return $this->last_insert_id(); <br>  } <br>  else return false; <br> } <br> <br> function update($tbname, $array, $where = '') <br> { <br>  $array=$this->escape($array); <br>  if($where) <br>  { <br>   $tb_fields=$this->get_fields($tbname); // 增加判断字段是否存在 <br>    <br>   $sql = ''; <br>   foreach($array as $k=>$v) <br>   { <br>    if(in_array($k,$tb_fields)) <br>    { <br>     $k=str_replace(''','',$k); <br>     $sql .= ", `$k`='$v'"; <br>    } <br>   } <br>   $sql = substr($sql, 1); <br>    <br>   if($sql)$sql = "update `$tbname` set $sql where $where"; <br>   else return true; <br>  } <br>  else <br>  { <br>   $sql = "replace into `$tbname`(`".implode('`,`', array_keys($array))."`) values('".implode("','", $array)."')"; <br>  } <br>  return $this->query($sql,true); <br> } <br>  <br> function mysql_delete($tbname,$idarray,$filedname='id') <br> { <br>  $idwhere=is_array($idarray)?implode(',',$idarray):intval($idarray); <br>  $where=is_array($idarray)?"{$tbname}.{$filedname} in ({$idwhere})":" {$tbname}.{$filedname}={$idwhere}"; <br> <br>  return $this->query("delete from {$tbname} where {$where}",true); <br> } <br> <br> function get_fields($table) <br> { <br>  $fields=array(); <br>  $result=$this->fetch_all("show columns from `{$table}`"); <br>  foreach($result as $val) <br>  { <br>   $fields[]=$val['field']; <br>  } <br>  return $fields; <br> } <br> <br> function get_table_status($database) <br> { <br>  $status=array(); <br>  $r=$this->fetch_all("show table status from `".$database."`"); /////// show table status的性质与show table类似,不过,可以提供每个表的大量信息。 <br>  foreach($r as $v) <br>  { <br>   $status[]=$v; <br>  } <br>  return $status; <br> } <br> <br> function get_one_table_status($table) <br> { <br>  return $this->fetch_one("show table status like '$table'"); <br> } <br> <br> function create_fields($tbname,$fieldname,$size=0,$type='varchar') // 2010-5-14 修正一下 <br> {   <br>  if($size) <br>  { <br>   $size=strtoupper($type)=='varchar'?$size:8; <br>   $this->query("alter table `{$tbname}` add `$fieldname` {$type}( {$size} )  not null",true); <br>  } <br>  else $this->query("alter table `{$tbname}` add `$fieldname` mediumtext  not null",true); <br>  return true; <br> } <br> <br> function get_tables() //获取所有表表名 <br> { <br>  $tables=array(); <br>  $r=$this->fetch_all("show tables"); <br>  foreach($r as $v) <br>  { <br>   foreach($v as $v_) <br>   { <br>    $tables[]=$v_; <br>   } <br>  } <br>  return $tables; <br> } <br> <br> function create_model_table($tbname) //创建一个内容模型表(start:初始只有字段contentid int(20),用于内容表,/////////////////////// update:2010-5-20     默认加入`content` mediumtext not null,字段) <br> { <br>  if(in_array($tbname,$this->get_tables())) return false;  ///////////////////// 当表名已经存在时,返回 false <br>  if($this->query("create table `{$tbname}` ( <br>`contentid` mediumint(8) not null , <br>`content` mediumtext not null, <br>key ( `contentid` )  <br>) engine = myisam default ",true))return true;   ////////////////////  成功则返回 true <br>  return false; //////////////失败返回 false <br> } <br> <br> function create_table($tbname) //创建一个会员模型空表(初始只有字段userid int(20),用于会员表,2010-4-26) <br> { <br>  if(in_array($tbname,$this->get_tables())) return false; <br>  if($this->query("create table `{$tbname}` ( <br>`userid` mediumint(8) not null , <br>key ( `userid` )  <br>) engine = myisam default charset=utf8",true))return true; <br>  return false; <br> } <br> <br> function escape($str) // 过滤危险字符 <br> { <br>  if(!is_array($str)) return str_replace(array('n', 'r'), array(chr(10), chr(13)),mysql_real_escape_string(preg_replace($this->search,$this->replace, $str), $this->dblink)); <br>  foreach($str as $key=>$val) $str[$key] = $this->escape($val); <br>  return $str; <br> } <br> <br> function filter_pass($string, $allowedtags = '', $disabledattributes = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavaible', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragdrop', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterupdate', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmoveout', 'onmouseo教程ver', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload')) <br> { <br>  if(is_array($string)) <br>  { <br>   foreach($string as $key => $val) $string[$key] = $this->filter_pass($val, allowed_htmltags); <br>  } <br>  else <br>  { <br>   $string = preg_replace('/s('.implode('|', $disabledattributes).').*?([s>])/', '', preg_replace('/<(.*?)>/ie', "'<'.preg_replace(array('/网页特效:[^"']*/i', '/(".implode('|', $disabledattributes).")[ ]*=[ ]*["'][^"']*["']/i', '/s+/'), array('', '', ' '), stripslashes('')) . '>'", strip_tags($string, $allowedtags))); <br>  } <br>  return $string; <br> } <br> <br> function drop_table($tbname) <br> { <br>  return $this->query("drop table if exists `{$tbname}`",true); <br> } <br> <br> function version() <br> { <br>  return mysql_get_server_info($this->dblink); <br> } <br>} <br><p>希望本文所述对大家的PHP程序设计有所帮助。</p><h4>您可能感兴趣的文章:</h4><ul><li>Php连接及读取和写入mysql数据库的常用代码</li><li>PHP连接和操作MySQL数据库基础教程</li><li>php mysql数据库操作类</li><li>PHP备份/还原MySQL数据库的代码</li><li>php实现mysql数据库备份类</li><li>常用的PHP数据库操作方法(MYSQL版)</li><li>php连接mysql数据库代码</li><li>PHP实现PDO的mysql数据库操作类</li><li>php实现MySQL数据库备份与还原类实例</li><li>PHP数据库操作之基于Mysqli的数据库操作类库</li><li>全新的PDO数据库操作类php版(仅适用Mysql)</li><li>PHP基于ORM方式操作MySQL数据库实例</li></ul><span id="art_bot"></span></p></dl> <style type="text/css">.social-share p{font-size:8px;}</style> <div class="social-share"></div> </div> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <li class="list-group-item" style="background: #f5f5f5;border-radius: 4px;margin-bottom: 10px;"> <br>上一条:<br> <a href="/demo333/35287.html" class="list-group-item-heading">PHP原生函数一定好吗?</a> <br>下一条:<br> <a href="/demo333/35289.html" class="list-group-item-heading">php表单敏感字符过滤类</a> </li> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <form class="form-horizontal" role="form" style="background: #f5f5f5;border: 1px solid #ddd;padding:10px 10px 0px;border-radius: 4px;margin-bottom: 10px;" id="myForm" action="/index/art/comment.html" method="post"> <p><span style="font-size: 12px;">昵称:</span><input type="text" name="nick" style="width: 100px;border-radius: 8px;"><span id="check_nick" style="font-size: 8px;color: red;display: none;padding-left: 45px;padding-top: 8px;"></span></p> <p><span style="font-size: 12px;">邮箱:</span><input type="text" name="email" style="width: 160px;border-radius: 8px;"></p> <textarea name="comment" id="comment" style="width:80%; height:100%"></textarea> <input type="hidden" name="art_id" value="35288"> <input type="submit" value="发表评论" style="font-size: 12px;position: relative;left: 71%;"> </form> </div> </div> <div class="row clearfix"><div class="col-md-12 column"><div class="form-group" style="margin-bottom: 5px;padding: 0 5px;"><span>0条评论</span> <span style="font-size:8px;color:red">(评论内容有缓存机制,请悉知!)</span><div style="float: right;font-size: 12px;"><a href="" style="padding: 0 5px;">最新</a><a href="">最热</a></div></div></div></div> <div class="row clearfix"> <div class="col-md-12 column"> </div> </div> </div> <div class="col-md-4 column"> <div class="row clearfix"> <div class="col-md-12 column"> <!-- 正方ad --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4802265324400044" data-ad-slot="1693614294" data-ad-format="auto" data-full-width-responsive="true"></ins> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script> </div> </div> <!-- 分类 --> <div class="row clearfix"> <div class="col-md-12 column"> <ul style="background: #f5f5f5;border: 1px solid #ddd;border-radius: 4px;list-style: none;"><li style="font-size: 16px;font-weight: bold;padding: 10px 0 10px;">分类目录</li> <li class="btn"><a href="/demo777/cat_id/1.html">人生(杂谈)</a></li> <li class="btn"><a href="/demo777/cat_id/2.html">技术</a></li> <li class="btn"><a href="/demo777/cat_id/18.html">linux</a></li> <li class="btn"><a href="/demo777/cat_id/19.html">Java</a></li> <li class="btn"><a href="/demo777/cat_id/20.html">php</a></li> <li class="btn"><a href="/demo777/cat_id/30.html">框架(架构)</a></li> <li class="btn"><a href="/demo777/cat_id/31.html">前端</a></li> <li class="btn"><a href="/demo777/cat_id/33.html">ThinkPHP</a></li> <li class="btn"><a href="/demo777/cat_id/34.html">数据库</a></li> <li class="btn"><a href="/demo777/cat_id/35.html">微信(小程序)</a></li> <li class="btn"><a href="/demo777/cat_id/36.html">Laravel</a></li> <li class="btn"><a href="/demo777/cat_id/37.html">Redis</a></li> <li class="btn"><a href="/demo777/cat_id/38.html">Docker</a></li> <li class="btn"><a href="/demo777/cat_id/39.html">Go</a></li> <li class="btn"><a href="/demo777/cat_id/40.html">swoole</a></li> <li class="btn"><a href="/demo777/cat_id/41.html">Windows</a></li> <li class="btn"><a href="/demo777/cat_id/42.html">Python</a></li> <li class="btn"><a href="/demo777/cat_id/43.html">苹果(mac/ios)</a></li> </ul> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <ul style="background: #f5f5f5;border: 1px solid #ddd;border-radius: 4px;list-style: none;"><li style="font-size: 16px;font-weight: bold;padding: 10px 0 10px;">相关文章</li> <li><a href="/demo333/96842.html">Laravel从Accel获得5700万美元A轮融资</a>(0个评论)</li> <li><a href="/demo333/96839.html">PHP 8.4 Alpha 1现已发布!</a>(0个评论)</li> <li><a href="/demo333/96826.html">用Time Warden监控PHP中的代码处理时间</a>(0个评论)</li> <li><a href="/demo333/96806.html">在PHP中使用array_pop + yield实现读取超大型目录功能示例</a>(0个评论)</li> <li><a href="/demo333/96795.html">Property Hooks RFC在PHP 8.4中越来越接近现实</a>(0个评论)</li> </ul> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <ul style="background: #f5f5f5;border: 1px solid #ddd;border-radius: 4px;list-style: none;"><li style="font-size: 16px;font-weight: bold;padding: 10px 0 10px;">近期文章</li> <li><a href="/demo333/96854.html">在windows10中升级go版本至1.24后LiteIDE的Ctrl+左击无法跳转问题解决方案</a>(0个评论)</li> <li><a href="/demo333/96853.html">智能合约Solidity学习CryptoZombie第四课:僵尸作战系统</a>(0个评论)</li> <li><a href="/demo333/96852.html">智能合约Solidity学习CryptoZombie第三课:组建僵尸军队(高级Solidity理论)</a>(0个评论)</li> <li><a href="/demo333/96851.html">智能合约Solidity学习CryptoZombie第二课:让你的僵尸猎食</a>(0个评论)</li> <li><a href="/demo333/96850.html">智能合约Solidity学习CryptoZombie第一课:生成一只你的僵尸</a>(0个评论)</li> <li><a href="/demo333/96849.html">在go中实现一个常用的先进先出的缓存淘汰算法示例代码</a>(0个评论)</li> <li><a href="/demo333/96848.html">在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能</a>(0个评论)</li> <li><a href="/demo333/96847.html">在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能</a>(1个评论)</li> <li><a href="/demo333/96846.html">在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能</a>(95个评论)</li> <li><a href="/demo333/96845.html">gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案</a>(0个评论)</li> </ul> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <ul style="background: #f5f5f5;border: 1px solid #ddd;border-radius: 4px;list-style: none;"><li style="font-size: 16px;font-weight: bold;padding: 10px 0 10px;">近期评论</li> <li> <p style="font-size: 10px;margin-bottom: 0px;">122 在</p><a href="/demo333/96820.html">学历:一种延缓就业设计,生活需求下的权衡之选</a><span style="font-size: 10px;">中评论</span> 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人.. </li> <li> <p style="font-size: 10px;margin-bottom: 0px;">123 在</p><a href="/demo333/96603.html">Clash for Windows作者删库跑路了,github已404</a><span style="font-size: 10px;">中评论</span> 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分.. </li> <li> <p style="font-size: 10px;margin-bottom: 0px;">原梓番博客 在</p><a href="/demo333/96695.html">在Laravel框架中使用模型Model分表最简单的方法</a><span style="font-size: 10px;">中评论</span> 好久好久都没看友情链接申请了,今天刚看,已经添加。.. </li> <li> <p style="font-size: 10px;margin-bottom: 0px;">博主 在</p><a href="/demo333/435.html">佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法</a><span style="font-size: 10px;">中评论</span> @1111老铁这个不行了,可以看看近期评论的其他文章.. </li> <li> <p style="font-size: 10px;margin-bottom: 0px;">1111 在</p><a href="/demo333/435.html">佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法</a><span style="font-size: 10px;">中评论</span> 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光.. </li> </ul> </div> </div> <div class="row clearfix"> <div class="col-md-12 column"> <div class="btn-group" style="width: 100%"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">文章归档 <span class="caret"></span></button> <ul class="dropdown-menu" role="menu"> <li style="display: inline-block;"><a href="/demo777/date/2016-10.html" style="color:#337ab7;padding:3px 5px;">2016-10</a></li> <li style="display: inline-block;"><a href="/demo777/date/2016-11.html" style="color:#337ab7;padding:3px 5px;">2016-11</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-06.html" style="color:#337ab7;padding:3px 5px;">2017-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-07.html" style="color:#337ab7;padding:3px 5px;">2017-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-08.html" style="color:#337ab7;padding:3px 5px;">2017-08</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-09.html" style="color:#337ab7;padding:3px 5px;">2017-09</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-11.html" style="color:#337ab7;padding:3px 5px;">2017-11</a></li> <li style="display: inline-block;"><a href="/demo777/date/2017-12.html" style="color:#337ab7;padding:3px 5px;">2017-12</a></li> <li style="display: inline-block;"><a href="/demo777/date/2018-01.html" style="color:#337ab7;padding:3px 5px;">2018-01</a></li> <li style="display: inline-block;"><a href="/demo777/date/2018-02.html" style="color:#337ab7;padding:3px 5px;">2018-02</a></li> <li style="display: inline-block;"><a href="/demo777/date/2018-03.html" style="color:#337ab7;padding:3px 5px;">2018-03</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-03.html" style="color:#337ab7;padding:3px 5px;">2020-03</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-04.html" style="color:#337ab7;padding:3px 5px;">2020-04</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-05.html" style="color:#337ab7;padding:3px 5px;">2020-05</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-06.html" style="color:#337ab7;padding:3px 5px;">2020-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-07.html" style="color:#337ab7;padding:3px 5px;">2020-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2020-09.html" style="color:#337ab7;padding:3px 5px;">2020-09</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-02.html" style="color:#337ab7;padding:3px 5px;">2021-02</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-03.html" style="color:#337ab7;padding:3px 5px;">2021-03</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-04.html" style="color:#337ab7;padding:3px 5px;">2021-04</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-05.html" style="color:#337ab7;padding:3px 5px;">2021-05</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-06.html" style="color:#337ab7;padding:3px 5px;">2021-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-07.html" style="color:#337ab7;padding:3px 5px;">2021-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-08.html" style="color:#337ab7;padding:3px 5px;">2021-08</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-09.html" style="color:#337ab7;padding:3px 5px;">2021-09</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-10.html" style="color:#337ab7;padding:3px 5px;">2021-10</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-11.html" style="color:#337ab7;padding:3px 5px;">2021-11</a></li> <li style="display: inline-block;"><a href="/demo777/date/2021-12.html" style="color:#337ab7;padding:3px 5px;">2021-12</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-01.html" style="color:#337ab7;padding:3px 5px;">2022-01</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-02.html" style="color:#337ab7;padding:3px 5px;">2022-02</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-05.html" style="color:#337ab7;padding:3px 5px;">2022-05</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-06.html" style="color:#337ab7;padding:3px 5px;">2022-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-07.html" style="color:#337ab7;padding:3px 5px;">2022-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-08.html" style="color:#337ab7;padding:3px 5px;">2022-08</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-09.html" style="color:#337ab7;padding:3px 5px;">2022-09</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-10.html" style="color:#337ab7;padding:3px 5px;">2022-10</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-11.html" style="color:#337ab7;padding:3px 5px;">2022-11</a></li> <li style="display: inline-block;"><a href="/demo777/date/2022-12.html" style="color:#337ab7;padding:3px 5px;">2022-12</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-01.html" style="color:#337ab7;padding:3px 5px;">2023-01</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-02.html" style="color:#337ab7;padding:3px 5px;">2023-02</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-03.html" style="color:#337ab7;padding:3px 5px;">2023-03</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-04.html" style="color:#337ab7;padding:3px 5px;">2023-04</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-05.html" style="color:#337ab7;padding:3px 5px;">2023-05</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-06.html" style="color:#337ab7;padding:3px 5px;">2023-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-07.html" style="color:#337ab7;padding:3px 5px;">2023-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-08.html" style="color:#337ab7;padding:3px 5px;">2023-08</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-09.html" style="color:#337ab7;padding:3px 5px;">2023-09</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-10.html" style="color:#337ab7;padding:3px 5px;">2023-10</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-11.html" style="color:#337ab7;padding:3px 5px;">2023-11</a></li> <li style="display: inline-block;"><a href="/demo777/date/2023-12.html" style="color:#337ab7;padding:3px 5px;">2023-12</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-01.html" style="color:#337ab7;padding:3px 5px;">2024-01</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-02.html" style="color:#337ab7;padding:3px 5px;">2024-02</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-03.html" style="color:#337ab7;padding:3px 5px;">2024-03</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-04.html" style="color:#337ab7;padding:3px 5px;">2024-04</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-05.html" style="color:#337ab7;padding:3px 5px;">2024-05</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-06.html" style="color:#337ab7;padding:3px 5px;">2024-06</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-07.html" style="color:#337ab7;padding:3px 5px;">2024-07</a></li> <li style="display: inline-block;"><a href="/demo777/date/2024-09.html" style="color:#337ab7;padding:3px 5px;">2024-09</a></li> </ul> </div> </div> </div> </div> <a href="#top" style="width: 35px;height: 35px;background: #286090;position: fixed;right: 55px;bottom: 20%;border-radius: 50px;line-height: 30px;text-align: center;color: #fff;z-index: 1000;">Top</a> </div> </div> </div> <!-- 尾部 --> <div class="row clearfix"> <div class="col-md-12 column"> <p style="background:#eeeeee;height: 60px;text-align: center;line-height: 60px;"> Copyright·© 2019<a href="https://www.zongscan.com/" title="侯体宗的博客"> 侯体宗</a>版权所有· <a rel="nofollow" href="http://beian.miit.gov.cn/" target="_blank">粤ICP备20027696号</a> <a rel="nofollow" target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=18fd111045dfedfaaec63e92733754db7c223601aa9d81a777ecfaa2c9bea9a1"><img style="width: 80px;" src="//pub.idqqimg.com/wpa/images/group.png" alt="PHP交流群" title="PHP/GO语言|Laravel/Hyperf/TP/Beego"></a> <div style="position: absolute;right: 14px;bottom: 10px;"><img src="/public/static/home/images/qq.png" alt="侯体宗的博客" style="width: 60px;"></div> </p> </div> </div> </div> </div> </div> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="/public/static/home/js/jquery.form.min.js"></script> <script type="text/javascript" src="/public/static/home/js/3dtags.js"></script> <script>var odsmE1 = odsmE1 || [];(function() { var yZ$bV2 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74"]("\x73\x63\x72\x69\x70\x74"); yZ$bV2["\x73\x72\x63"] = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x68\x6d\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x68\x6d\x2e\x6a\x73\x3f\x65\x37\x64\x39\x34\x35\x38\x39\x36\x64\x36\x61\x35\x65\x62\x34\x35\x37\x30\x62\x66\x32\x39\x66\x64\x31\x62\x65\x38\x38\x61\x65"; var MsUTUSUX3 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73\x42\x79\x54\x61\x67\x4e\x61\x6d\x65"]("\x73\x63\x72\x69\x70\x74")[0]; MsUTUSUX3["\x70\x61\x72\x65\x6e\x74\x4e\x6f\x64\x65"]["\x69\x6e\x73\x65\x72\x74\x42\x65\x66\x6f\x72\x65"](yZ$bV2, MsUTUSUX3);})();</script> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <script> (function(){ var src = "https://jspassport.ssl.qhimg.com/11.0.1.js?d182b3f28525f2db83acfaaf6e696dba"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script> <script> (function(){ var el = document.createElement("script"); el.src = "https://sf1-scmcdn-tos.pstatp.com/goofy/ttzz/push.js?7b5b29801251a92e76b4acf3f4dfadc5583b6d04c3e7ceb5076d523f4c4fbf4fc6b27999073bf9f2ec748fd09c75d47d08a12a83067bdae4d3f3b7bcef45a18f2b8d7c8c6655c9b00211740aa8a98e2e"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script> <!--<script src="https://cdn.bootcdn.net/ajax/libs/social-share.js/1.0.9/js/share.min.js"></script>--> <!--<script src="https://cdn.bootcdn.net/ajax/libs/lrsjng.jquery-qrcode/0.9.5/jquery.qrcode.min.js"></script>--> <!--编辑器--> <script type="text/javascript" src="/public/static/home/js/ueditor/ueditor.config.js"></script> <script type="text/javascript" src="/public/static/home/js/ueditor/ueditor.all.min.js"></script> <script type="text/javascript"> var ue = UE.getEditor('comment',{ toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|','bold', 'italic', 'underline', 'fontborder','snapscreen','scrawl','insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'pagebreak', 'template', '|', 'simpleupload']],initialFrameWidth:null,initialFrameHeight:100}); </script> <script> $(document).ready(function() { // bind form using ajaxForm $('#myForm').ajaxForm({ dataType: 'json', // success: processJson success: function(data){ if (data.error == 1) { alert(data.info); location.reload(); }else{ $("#check_nick").html(data.info); $("#check_nick").css("display","block"); }; } }); }); //dianzan function dianzan(obj,id){ //alert($(obj).html()); id = id; $.ajax({ url: "/index/art/dianzan.html",//请求地址 type: "post",//请求方式 dataType: "json",//返回数据类型 data: {id:id},//发送的参数 }) .done(function(data) { if(data.error==0){ alert(data.info); }else{ //alert(data.zan); $(obj).children('.rezan').html(data.zan); $(obj).removeAttr("onclick");//防重复点击 } }) .fail(function() { alert("ajxs交互失败"); }) return false; } </script> </body> </html><script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="22d25889715cd7397695ecdf-|49" defer></script>