ICode9

精准搜索请尝试: 精确搜索
  • thinkphp5-模型2021-10-30 18:04:22

    基本用法 命令行生成User模型 php think make:model index/User 模型调用 $user = new \app\index\model\User(); $user = $user->where('id',3)->find(); var_dump($user->toArray()); $user = model('user')->where('id',3)->find(); var

  • thinkphp5-安装配置2021-10-30 15:07:21

    composer方式下载源码 composer create-project topthink/think=5.0.* tp5 --prefer-dist nginx配置(默认不支持path_info模式,要使用?s=/的方式访问地址) server { listen 80; server_name www.tp5.com; root /var/www/tp5/public; inde

  • thinkphp5-配置2021-10-30 15:06:18

    配置目录 系统默认的配置文件目录就是应用目录application下面 定义配置文件目录和应用目录同级 define('CONF_PATH', __DIR__.'/../config/'); 读取配置 echo \think\Config::get('default_return_type'); echo config('default_return_type'); 设置配置 Config::set('配置参数&

  • thinkphp5-路由2021-10-30 15:05:38

    路由开关模式 普通模式 'url_route_on' => false, 混合模式 'url_route_on' => true, 'url_route_must'=> false, 强制模式 'url_route_on' => true, 'url_route_must' => true, 路由定义 route.php use t

  • thinkphp5-请求2021-10-30 15:04:18

    实例化请求对象 $request = Request::instance(); $request = request(); 获取请求信息 $request = Request::instance(); // 获取当前域名 echo 'domain: ' . $request->domain() . '<br/>'; // 获取当前入口文件 echo 'file: ' . $request->baseFile() . �

  • thinkphp5-数据库2021-10-30 15:02:32

    基本使用 mysql生成数据库 create database tp5; use tp5; mysql生成数据表 create table user( id int unsigned NOT NULL AUTO_INCREMENT, name varchar(100), status tinyint(2), primary key(id) )engine=innodb charset=utf8mb4; 数据库配置 <?php retur

  • thinkphp5-控制器2021-10-30 15:01:55

    命令行生成控制器 php think make:controller index/User 渲染模板 use think\View; $view = new View(); $view->assign('name','huyongjian'); return $view->fetch('index'); 初始化方法 public function _initialize() { echo 'ini

  • thinkphp5微信公众号推送模板消息2021-10-28 16:30:47

    1.获取到token, 2.把需要的信息加到模板里,转码推送. /** * 发送模板消息 */ public function send_notice($openid,$data){ //获取access_token if (Session::get('access_token')){ $access_token2=Session::get('access_token'); }else{

  • thinkphp5数据的事务操作2021-10-27 12:34:36

    db()->startTrans();//开启事务 $res_a = db('sendgroup')->where(['pc_id'=>$pc_id,'sendblock_id'=>$sendblock_id,'pc_id'=>$pc_id])->delete(); $res_b = db('sendgroup')->insertAll($data); if($re

  • thinkphp5最新图书管理系统2021-10-18 21:34:10

    thinkphp5最新图书管理系统 thinkphp5图书管理系统,PHP毕业程序设计图书借阅学生交作业必备无加密源码带后台和数据库,Thinkphp响应式图书管理系统带后台三级菜单 源码介绍 演示地址:http://www.phprr.com/show-873

  • thinkphp5 同时使用hasWhere和where导致的关联主键字段名冲突的问题2021-09-29 21:34:56

    thinkphp5使用同时使用hasWhere和where,‘order_code’就是两个表关联的主键,两个表都存在‘order_code’ 运行 Order::hasWhere(‘orderstate’, w h e r

  • Thinkphp5未开启强制路由导致的RCE 漏洞复现与分析2021-09-28 23:00:23

    影响版本 小于5.0.23小于5.1.30 5.0.x ?s=index/think\config/get&name=database.username # 获取配置信息 ?s=index/\think\Lang/load&file=../../test.jpg # 包含任意文件 ?s=index/\think\Config/load&file=../../t.php # 包含任意.php文件 ?s=index/\think\app/in

  • thinkphp5 原生sql带分页方法2021-08-04 09:03:14

    1、先在顶部引入use think\paginator\driver\Page; 2、使用下例代码 $pageNumber = input('page')? input('page'):'0';//客户端传过来的分页 if($pageNumber > 0){ $pageNumber_one = $pageNumber-1; }else{

  • ThinkPHP5.x注入漏洞学习2021-08-03 12:01:41

    ThinkPHP5.x注入漏洞学习 前言 以下复现均需要在application/database.php 文件中配置数据库相关信息,并开启 **application/config 中的 ** app_debug 和 app_trace 通过以下命令获取测试环境代码: composer create-project --prefer-dist topthink/think=版本 tpdemo 将 compos

  • 【thinkphp5操作redis系列教程】哈希类型之hMget2021-07-03 15:03:27

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hMset2021-07-03 15:03:18

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hVals2021-07-03 15:02:59

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hIncrBy,hIncrByFloat2021-07-03 15:02:44

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hKeys2021-07-03 15:02:34

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hDel2021-07-03 15:02:13

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hSetNx2021-07-03 15:01:52

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • 【thinkphp5操作redis系列教程】哈希类型之hLen2021-07-03 15:01:31

    <?php namespace app\index\controller; use Redis; class Index { public function index() { $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->flushAll(); /** * redis hash是

  • thinkphp5含有跳转的分页效果2021-07-02 18:34:02

    实现的效果: <?php namespace think\paginator\driver; use think\Paginator; class Bootstrap extends Paginator { /** * 上一页按钮 * @param string $text * @return string */ protected function getPreviousButton($text = "上一页&qu

  • ThinkPHP5浏览器关闭,继续执行php脚本2021-06-25 14:33:28

    ignore_user_abort(); //即使Client断开(如关掉浏览器),PHP脚本也可以继续执行. set_time_limit(0); //执行时间为无限制,php默认的执行时间是30秒,通过set_time_limit(0)可以让程序无限制的执行下去 $interval=5; //每隔5分钟运行 do{$fp = fopen("test.txt","a"); fwrite($fp,

  • PHP系列 | ThinkPHP5数据库迁移工具 migration2021-06-04 23:02:22

    了解更多,请关注微信公众号ThinkPHP5数据库迁移工具 migration什么是Migration?migration用谷歌翻译是移民的意思,在PHP中我们将它理解为迁移,将Migration用在数据库上就理解为数据库迁移咯。在migration开发之前,我们都是手写SQL创建表语句,创建成功之后需要手动在数据库执行,项目初始化

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有