作者:AlbertWen
添加时间:2012-06-25 13:46:46
修改时间:2025-09-11 13:16:39
分类:
16.编程基础/Web安全
编辑
墨西哥同学周末很郁闷的在宾馆上网,发现youtube被ban了,于是写个了tool解决这个问题。顺带想到了一种利用 google 统计的漏洞,写在这里了
http://sirdarckcat.blogspot.com/2009/04/how-to-use-google-analytics-to-dos.html
这个问题实际上是由于 webserver 的 request field limit 造成的。
当 http request header 过长时,webserver 会产生一个400 或者 4xx 错误
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
作者:AlbertWen
添加时间:2012-06-25 10:43:21
修改时间:2025-09-09 08:13:00
分类:
11.PHP基础
编辑
<?php
/*检测并清除BOM*/
if(isset($_GET['dir'])){
$basedir=$_GET['dir'];
}else{
$basedir = '.';
}
$auto = 1;
checkdir($basedir);
作者:AlbertWen
添加时间:2012-06-23 21:47:44
修改时间:2025-09-09 07:45:25
分类:
11.PHP基础
编辑
我个人理解:getcwd()会随着包含文件的改变而改变,而dirname(__FILE__)不会。即 getcwd() 表示获取当前执行文件的物理路径。
作者:AlbertWen
添加时间:2012-06-22 15:57:35
修改时间:2025-09-11 08:17:12
分类:
11.PHP基础
编辑
1.DAO模式使用环境
具体类图如下。

作者:AlbertWen
添加时间:2012-06-22 00:18:40
修改时间:2025-09-09 07:47:12
分类:
12.PHP库/系统/微信
编辑
S方法支持缓存有效期,在很多情况下,可能我们并不需要有效期的概念,或者使用文件方式的缓存就能够满足要求,所以系统还提供了一个专门用于文件方式的快速缓存方法F方法。F方法只能用于缓存简单数据类型(数字型、字符串、数值),不支持有效期和缓存对象,使用如下:
作者:AlbertWen
添加时间:2012-06-21 10:28:33
修改时间:2025-09-09 07:28:42
分类:
16.编程基础/Web安全
编辑
作者:AlbertWen
添加时间:2013-07-01 21:13:18
修改时间:2025-09-09 07:28:45
分类:
16.编程基础/Web安全
编辑
XSS攻击在最近很是流行,往往在某段代码里一不小心就会被人放上XSS攻击的代码,看到国外有人写上了函数,咱也偷偷懒,悄悄的贴上来。。。
原文如下:
The goal of this function is to be a generic function that can be used to parse almost any input and render it XSS safe. For more information on actual XSS attacks, check out http://ha.ckers.org/xss.html. Another excellent site is the XSS Database which details each attack and how it works.
作者:AlbertWen
添加时间:2013-07-12 11:13:21
修改时间:2025-09-13 16:03:55
分类:
11.PHP基础
编辑
作者:AlbertWen
添加时间:2012-06-20 21:22:22
修改时间:2025-09-09 07:02:56
分类:
12.PHP库/系统/微信
编辑
今天登录到DiscuzX2.0后台老是自动退出,无法登录。
我先后检查了以下内容:
1. ucenter通信正常
2. cookies作用域设置了。
作者:AlbertWen
添加时间:2014-10-21 09:19:39
修改时间:2025-09-14 13:10:05
分类:
11.PHP基础
编辑
使用XHProf注意事项:
1、如果不安装 Graphviz,点击链接“View Full Callgraph”,会报如下错误:
failed to execute cmd: " dot -Tpng". stderr: `Format: "png" not recognized. Use one of: canon cmap cmapx cmapx_np dot eps fig gv imap imap_np ismap pic plain plain-ext pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4 '
2、Graphviz 需要开启PHP的 proc_open类函数;
3、XHProf的输出目录(xhprof.output_dir=/data/xhprof) 要有写的权限,直接 777 吧!