php_sapi_name() 是用来检测PHP运行环境的函数。
该函数返回一个描述PHP与WEB服务器接口的小写字符串。
例如:aolserver, apache,apache2filter, apache2handler, caudium, cgi(until PHP 5.3),cgi-fcgi, cli, continuity, embed, isapi, litespeed, milter, nsapi, phttpd, pi3web, roxen,thttpd, tux, webjames.
cd /home/wenjianbao/456 git clone https://github.com/sumory/lor cd lor make install LOR_HOME=/alidata/server/lua/lor LORD_BIN=/alidata/server/lua/lor # 创建 命令行 工具 sudo ln -s /alidata/server/lua/lor/lord /usr/local/bin/lord
墨西哥同学周末很郁闷的在宾馆上网,发现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.
<?php /*检测并清除BOM*/ if(isset($_GET['dir'])){ $basedir=$_GET['dir']; }else{ $basedir = '.'; } $auto = 1; checkdir($basedir);
我个人理解:getcwd()会随着包含文件的改变而改变,而dirname(__FILE__)不会。即 getcwd() 表示获取当前执行文件的物理路径。
1.DAO模式使用环境
具体类图如下。
S方法支持缓存有效期,在很多情况下,可能我们并不需要有效期的概念,或者使用文件方式的缓存就能够满足要求,所以系统还提供了一个专门用于文件方式的快速缓存方法F方法。F方法只能用于缓存简单数据类型(数字型、字符串、数值),不支持有效期和缓存对象,使用如下:
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.