-
PHP伪造页面referer来源地址几种办法
[PHP教程] 2022-02-10 14:40:36 154人阅读
referer是php用来判断页面上级来源页面的一个超级变局变量了,我们可以使用referer来判断是从那个页面进入到此页面了,这样我们可以进行更好的跟踪了,下面我就来给各位朋友整理了几种伪造页面referer来源例子,希望例子...[详细]
-
php 阻止单引号,双引号在接受页面转义
[PHP教程] 2022-02-10 14:40:10 197人阅读
页面转义单引号,双引号对于我们网站安全有很大的问题,我们经常会使用addslashes()和stripslashes()进行转义之后存入数据库了,这样可以防止sql注入了,下面来看看. PHP页面中如果不希望出现以下情况: 单引号被转义为 ...[详细]
-
php ZipArchive打包压缩zip文件示例
[PHP教程] 2022-02-10 14:39:48 148人阅读
ZipArchive类是一个文件压缩解压类是一个php自来的zip类,我们可以直接简单创建一个类然后就能实现打包了,下面小编给各位介绍一下吧,有需要了解的朋友可进入参考. 这里我采用的是php自带的ZipArchive类 a) 我们只需要...[详细]
-
php完成购物车程序代码
[PHP教程] 2022-02-10 14:39:25 72人阅读
购物车是现在电商开发者必须要做的一个功能了,下面我来给大家整理两个可用于电商网站的简单购物车程序代码,有兴趣的同学不防进入参考一下. 例子1:最近在写一个电子商务的网站,在做购物车的时候才发现php里面没有map...[详细]
-
php完成新浪短链接调用API代码
[PHP教程] 2022-02-10 14:39:05 99人阅读
前面写过了一篇文章是图片反盗链的,我自己弄得单独的页面就采用了sina的短连接,对于短连接来说还是方便的,地址太长占地方,下面分享源码,有注释,非原创,代码如下: ?php //Sina App_Key define(SINA_APPKEY, 31641035)...[详细]
-
PHPEXCEL导入excel表格产生数组
[PHP教程] 2022-02-10 14:38:43 188人阅读
本方法使用PHPEXCEL插件读取excel文件转化为数组了,后期还有没有完成的我们可以把转换成数组之后再保存到mysql数据库这个就非常的方便了,代码如下: ?php /** * @desc PHPEXCEL导入 * return array(); */ function im...[详细]
-
php中用缓存和不用缓存性能测试
[PHP教程] 2022-02-10 14:38:17 76人阅读
在未看到这篇文章之前我们一般不会对于缓存这么看重,经过测试之后我们发现使用文件缓存比直接使用数据库要快几倍,下面测试是6倍之多,下面一起来看看吧. 在Thinkphp项目中测试各种环境下的程序执行时间,不使用缓存,代...[详细]
-
定时执行php文件示例 php计划任务
[PHP教程] 2022-02-10 14:37:55 120人阅读
本文章给各位整理了三种php计划任务的例子,分别是利用了windows,linux及php的ignore_user_abort的函数来执行,下面我给大家分别举几个例子,有兴趣的朋友可进入参考. WINDOWS中设置计划任务执行PHP文件 1、写一个PHP程...[详细]
-
运用php.ini禁用一些危险php函数
[PHP教程] 2022-02-10 14:36:52 177人阅读
在很多时间我们php中的很多函数是没有用上的,而且对网站有存在很大的安全问题,下面我们利用PHP.ini 里有个 disable_functions 开关选项来关闭一些不需要使用的函数. 如果禁止了会出现如下提示: Warning: phpinfo() h...[详细]
-
php完成禁止IP段访问网站的代码
[PHP教程] 2022-02-10 14:36:33 81人阅读
有个前提条件是我们的页面必须是php类型的页面,如果你生成了html静态页面这种方法就不可行了,下面我们来看看php实现禁止IP段访问网站的代码,代码如下: ?php //加IP访问限制 if(getenv(HTTP_CLIENT_IP) strcasecmp(ge...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]