随笔分类 -  php语言

1 2 3 4 5 ··· 9 下一页
摘要:<?php /** * openssl 加密函数 * * @ entry@key 加密的 key,需要与解密的 key 值要一致 * @ iv使使/functionencrypt(entry, $ 阅读全文
posted @ 2021-10-03 20:45 孤舟残月浅笑嫣然 阅读(117) 评论(0) 推荐(0) 编辑
摘要:CREATE TABLE IF NOT EXISTS `diary` ( `diary_id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id值', `user_name` VARCHAR(255) NOT NULL COMMENT '加密用户名', 阅读全文
posted @ 2021-10-03 08:55 孤舟残月浅笑嫣然 阅读(128) 评论(0) 推荐(0) 编辑
摘要:1.在App目录下创建Helpers目录。 2.在Helpers目录下创建文件functions.php 3.在functions.php里写入如下测试代码: <?php functoin showMsg(){ die('这是公共函数内容。'); } 4.打开项目根目录下的 composer.jso 阅读全文
posted @ 2021-07-30 14:57 孤舟残月浅笑嫣然 阅读(71) 评论(0) 推荐(0) 编辑
摘要:在larvel中,闭包被广泛使用,复习一下php的闭包函数。 在PHP中匿名函数(Anonymous functions),也叫闭包函数( closures ),允许临时创建一个没有指定名称的函数。经常用作回调函数(callback)的参数。 当然,也有其他应用的情况。 注:php闭包是PHP5.3 阅读全文
posted @ 2021-06-11 17:41 孤舟残月浅笑嫣然 阅读(254) 评论(0) 推荐(0) 编辑
摘要:用composer 安装包文件时,如果报如下错误: Your requirements could not be resolved to an installable set of packages. 不要较真,运行如下命令解决: composer install --ignore-platform 阅读全文
posted @ 2021-03-08 05:50 孤舟残月浅笑嫣然 阅读(621) 评论(0) 推荐(0) 编辑
摘要:使用 Composer 安装 Laravel 安装器: composer global require laravel/installer 把 laravel 安装器软件位置写入环境变量,以使在各个目录下都可以直接输入 laravel new blog 命令安装 laravel。 第一步:打开终端, 阅读全文
posted @ 2021-03-08 05:31 孤舟残月浅笑嫣然 阅读(101) 评论(0) 推荐(0) 编辑
摘要:今天搞了一下系统,系统是 centos 7 的,后来发现宝塔面板打不开了。 执行一下下面的代码 ll /etc/init.d/ 执行df -h看看磁盘空间 确定不是以上原因, 执行下面命令: 1 mv /etc/init.d/bt /tmp/bt_back 2 cp /www/server/pane 阅读全文
posted @ 2021-02-28 21:26 孤舟残月浅笑嫣然 阅读(1398) 评论(0) 推荐(0) 编辑
摘要:/** * 打开nginx配置文件nginx.conf,添加以下内容 * 注意层级,在 http{ server { location { #这里添加 } } } 添加 */ location / { if (!-e $request_filename){ rewrite ^/(.*)$ /inde 阅读全文
posted @ 2021-02-14 22:59 孤舟残月浅笑嫣然 阅读(329) 评论(0) 推荐(0) 编辑
摘要:1.通过curl请求url函数 /** * 通过curl请求url函数,本函数用于测试curl_getinfo()的使用 * * @param string url@returnstring/functionrequest(url) { $ch = cur 阅读全文
posted @ 2021-01-29 00:20 孤舟残月浅笑嫣然 阅读(250) 评论(0) 推荐(0) 编辑
摘要:windows10 安装 composer 1.下载Windows版官方地址:https://getcomposer.org/Composer-Setup.exe 2.国内 composer 镜像地址(阿里云):https://developer.aliyun.com/composer 3.全局配置 阅读全文
posted @ 2021-01-08 12:28 孤舟残月浅笑嫣然 阅读(175) 评论(0) 推荐(0) 编辑
摘要:使用composer安装barryvdh/laravel-ide-helper $ composer require barryvdh/laravel-ide-helper # Then add to config/app Barryvdh\LaravelIdeHelper\IdeHelperSer 阅读全文
posted @ 2020-12-30 23:18 孤舟残月浅笑嫣然 阅读(137) 评论(0) 推荐(0) 编辑
摘要:php-redis代码库和文档地址:https://github.com/phpredis/phpredis/#readme string 字符串类型: <?php redis=newRedis();redis->connect("127.0.0.1", 6379); $redis->a 阅读全文
posted @ 2020-12-30 00:28 孤舟残月浅笑嫣然 阅读(186) 评论(0) 推荐(0) 编辑
摘要:php 压缩字符串函数:gzcompress() php解压字符串函数:gzuncompress() 效果图: 代码: <?php $str = "司马法曰:“国虽大,好战必亡;天下虽平,忘战必危。”司马法曰:“国虽大,好战必亡;天下虽平,忘战必危。”司马法曰:“国虽大,好战必亡;天下虽平,忘战必危 阅读全文
posted @ 2020-12-14 00:47 孤舟残月浅笑嫣然 阅读(364) 评论(0) 推荐(0) 编辑
摘要:PDO(PHP Data Objects)是一种在PHP里连接数据库的使用接口。PDO与mysqli曾经被建议用来取代原本PHP在用的mysql相关函数,基于数据库使用的安全性,因为后者欠缺对于SQL注入的防护。PDO的出现让PHP达到了一个新的高度。PDO扩展类库为PHP访问数据库定义了一个轻量级 阅读全文
posted @ 2020-11-15 22:59 孤舟残月浅笑嫣然 阅读(172) 评论(0) 推荐(0) 编辑
摘要:php 单页面登陆、注册试验程序 包括前后端验证,后端防 XSS 攻击,不包括 SQL 注入内容;密码散列值(hash)的创建与哈希验证。 /* 这是 php 官方推荐的密码处理函数 */ password_hash() //创建密码的散列(hash) password_verify() //验证密 阅读全文
posted @ 2020-10-08 20:30 孤舟残月浅笑嫣然 阅读(477) 评论(0) 推荐(0) 编辑
摘要:1.前端页面(index.php): <?php /** * 前端页面 */ session_start(); //生成随机字符串 function randomStr($max = 16){ $str = 'abcdefghijklmnopqrstuvwxyz'. '0123456789'. 'A 阅读全文
posted @ 2020-09-29 17:51 孤舟残月浅笑嫣然 阅读(730) 评论(0) 推荐(0) 编辑
摘要:注:不要复制以下的代码,经测试,报内有异常字符,并且定位到代码文件未尾,时有时无极不稳定,应该逐字敲入。 文件fileupload.class.php: <?php /** file: fileupload.class.php文件上传类FileUpload 本类的实例对象用于处理上传文件,可以上传一 阅读全文
posted @ 2020-09-19 19:52 孤舟残月浅笑嫣然 阅读(195) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 9 下一页
点击右上角即可分享
微信分享提示