博客文章

分类/ 标签/

2021-03-18

[编程技术] centos7 安装 Nginx、使用 nginx 记录

centos7 安装 Nginx、使用 nginx 记录 1、安装各种依赖 #gcc安装,nginx源码编译需要 yum install gcc-c++ #PCRE pcre-devel 安装,nginx 的 http 模块使用 pcre 来解析正则表达式 yum install -y pcre pcre-devel #zlib安装,nginx 使用zlib对http包的内

2021-03-14

[极限操作] Mac 下无法正常使用 Telegram 问题及解决方法

最近在 Mac 上使用 Telegram 时,发现无法正常连接,无论是 PAC 还是全局均无效,在 Google 之后大多数答案都是 Windows 下的处理方法,并不适用。 以下教程的前提是 Mac 配置了 ShadowsocksX-NG,开启后,浏览器可正常访问 Googl

2021-03-08

[编程技术] 数字权利激活工具 HWIDGen 的使用教程,一劳永逸的 Win10 完美激活,再也不怕重装系统了

众所周知,Windows 系统在安装完成之后,第一步就是激活系统,网上的一些激活方法大多数都是 KMS 激活,激活持续时间为半年,关于 KMS 激活方式,之前已经给大家介绍过几种方法: Windows 10 Business Editions 专业版在线激活密钥以及 Microsoft Office

2021-03-02

[编程技术] 纯 html+css 实现点击元素隐藏操作功能

利用 label 的 for 属性绑定 checkbox,此方法对按钮与盒子的层级关系没有限制(需用到 CSS3 选择器) <style> ul,li{ list-style: none; } *{ padding: 0; margin: 0; } .nav-con{ display: none; } .nav-box{ display: none; } .nav-con:checked ~ .nav-box{ display: block; } .nav-btn{ padding: 10px 15px; background:; } </style> <label for="control" class="nav-btn&#3

2021-02-22

[编程技术] 原生js实现ajax方法

由于不想多引入一个 jquery,百度了一个原生 js 实现 ajax 的方法(超简单),挺不错的,现在就分享给大家,也给大家做个参考。 首先新建一个 js 文件: function ajax(){ var ajaxData = { type:arguments[0].type || "GET", url:arguments[0].url || "", async:arguments[0].async || "true", data:arguments[0].data || null, header:arguments[0].header || {"Content-Type":"application/x-www-form-urlencoded"}, dataType:arguments[0].dataType || "text", beforeSend:arguments[0].beforeSend || function(){}, success:arguments[0].success || function(){}, error:arguments[0].error

2021-02-20

[编程技术] 【PHP】简单的实时在线人数统计

PHP 实现的简单在线人数统计功能 代码 //在线人数 function online_users() { $filename='online.txt'; $CookieName='OnLinePerson'; $onlineTime=30; $online=file($filename); $nowtime=$_SERVER['REQUEST_TIME']; $nowonline=array(); foreach($online as $line){ $row=explode('|',$line); $sesstime=trim($row[1]); if(($nowtime - $sesstime)<=$onlineTime){ $nowonline[$row[0]]=$sesstime; } } if(isset($_COOKIE[$CookieName])){ $uid=$_COOKIE[$CookieName]; }else{ $vid=0; do{ $vid++; $uid='U'.$vid; }while(array_key_exists($uid,$nowonline)); setcookie($CookieName,$uid); } $nowonline[$uid]=$nowtime; $total_online=count($nowonline); if($fp=@fopen($filename,'w')){ if(flock($fp,LOCK_EX)){ rewind($fp); foreach($nowonline as $fuid=>$ftime){ $fline=$fuid.'|'.$ftime."\n"; @fputs($fp,$fline); } flock($fp,LOCK_UN); fclose($fp); } } echo "$total_online"; } 这里解释下一些变量吧: $filename 数据文件的名字 $CookieName Cookie 名称,这里使用 Cookie 进

×