随笔分类 -  PHP语言

摘要:前端请求方法:GET PHPExcel类库下载链接: https://pan.baidu.com/s/1PkN5-jGhWWWvT2Vf07JiPQ 提取码: f66s 导出EXCEL乱码问题 解决方法:ob_end_clean(); //清除缓冲区,避免乱码 代码实现: public functi 阅读全文
posted @ 2020-05-13 15:44 A毛毛 阅读(1033) 评论(0) 推荐(0)
摘要:控制器 public function list() { // $list = member::get(); $list = member::paginate(2); return view('home/index/list',compact('list')); } 视图 <table> <tr> 阅读全文
posted @ 2020-05-10 23:13 A毛毛 阅读(380) 评论(0) 推荐(0)
摘要:漏洞描述 2019年1月11日,阿里云云盾应急响应中心监测到ThinkPHP官方发布安全更新,披露了一个高危安全漏洞,攻击者构造特定的 恶意请求,可以直接获取服务器权限,受影响的版本包括5.0.0~5.0.23版本及5.1多个版本。 漏洞造成的影响 由于ThinkPHP5框架对Request类的me 阅读全文
posted @ 2020-05-06 17:11 A毛毛 阅读(838) 评论(0) 推荐(1)
摘要:使用thinkphp开发小程序客服消息时,当用户发送消息后,IOS系统会提示“该小程序提供的服务出现故障,请稍后再试”,而安卓系统没有任何提示,并且两者都可以发送成功。 错误显示如下: 解决: 1、按照微信开发社区官方解决 https://developers.weixin.qq.com/commu 阅读全文
posted @ 2020-04-13 11:17 A毛毛 阅读(1900) 评论(0) 推荐(0)
摘要:public function valid() { if (isset($_GET["echostr"])) { $echoStr = $_GET["echostr"]; //valid signature , option if (!$this->token) { throw new Except 阅读全文
posted @ 2020-04-02 11:57 A毛毛 阅读(1239) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); abstract class msg{ protected $send = null; public function __construct($send){ $this->send = $s 阅读全文
posted @ 2020-01-12 17:31 A毛毛 阅读(177) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); // 适配器模式 /** * 查看天气接口 */ class Tianqi { public static function show(){ $arr = array('tem'=>28,'w 阅读全文
posted @ 2020-01-12 16:26 A毛毛 阅读(197) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); /** * 文章编辑类 */ class Article { protected $content; protected $art = null; public function __cons 阅读全文
posted @ 2020-01-12 16:01 A毛毛 阅读(153) 评论(0) 推荐(0)
摘要:html <html> <head> <meta charset="UTF-8"> <title>简单计算器</title> </head> <body> <h1>简单计算器</h1> <form action="10.php" method="post"> <input type="text" n 阅读全文
posted @ 2020-01-12 12:46 A毛毛 阅读(224) 评论(0) 推荐(0)
摘要:html <html> <head> <meta charset="UTF-8"> <title>责任链模式</title> </head> <body> <h1>责任链模式举报</h1> <form action="09-2.php" method="post"> <select name="le 阅读全文
posted @ 2020-01-12 12:17 A毛毛 阅读(251) 评论(0) 推荐(0)
摘要:html <html> <head> <meta charset="UTF-8"> <title>责任链模式</title> </head> <body> <h1>责任链模式举报</h1> <form action="09.php" method="post"> <select name="lev" 阅读全文
posted @ 2020-01-12 11:56 A毛毛 阅读(471) 评论(0) 推荐(0)
摘要:php提供的两个接口,一个被观察者接口SplSubject,一个或多个观察者接口SPLObserver,和一个可以储存对象的类SplObjectStorage。被观察者有三个方法,需要实现这三个方法,一个attach可以理解为添加一个观察者,detach可以理解为删除掉一个观察者,一个notify里 阅读全文
posted @ 2020-01-12 11:30 A毛毛 阅读(475) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); /** * 第一步,分别实例化 */ /*class Single { function __construct() { # code... } } $s1 = new Single(); $ 阅读全文
posted @ 2020-01-11 22:20 A毛毛 阅读(194) 评论(0) 推荐(0)
摘要:实现不修改原代码,扩展新功能 <?php header("Content-type:text/html;charset=utf-8"); /** * db接口 * 实现连接数据库函数conn */ interface db { function conn(); } /** * 工厂接口 * 实现创建 阅读全文
posted @ 2020-01-11 21:07 A毛毛 阅读(156) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); /** * 共同接口 */ interface db { function conn(); } /** * mysql类 */ class DbMysql implements db { pu 阅读全文
posted @ 2020-01-11 20:37 A毛毛 阅读(280) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); /** * 共同接口 */ interface db { function conn(); } /** * mysql类 */ class DbMysql implements db { pu 阅读全文
posted @ 2020-01-11 20:22 A毛毛 阅读(379) 评论(0) 推荐(0)
摘要:<?php header("Content-type:text/html;charset=utf-8"); /** * 虎 */ abstract class Tiger { public abstract function climb(); } /** * x虎 */ class Xtiger e 阅读全文
posted @ 2020-01-11 19:59 A毛毛 阅读(184) 评论(0) 推荐(0)
摘要:一、Apache的伪静态配置 1、网站根目录下需要有 .htaccess 文件,没有则自己创建一个,内容如下: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{RE 阅读全文
posted @ 2020-01-08 10:16 A毛毛 阅读(561) 评论(0) 推荐(0)