php模块和类库

PHP程序漏洞产生的原因和防范方法
     摘要: 【友情链接:http://www.tjcuxiao.com 和http://www.mujiz.cn】

滥用include

1.漏洞原因:

Include是编写PHP网站中最常用的函数,并且支持相对路径。有很多PHP脚本直接把某输入变量作为Include的参数,造成任意引用脚本、绝对路径泄露等漏洞。看以下代码:


...
$includepage=$_GET["includepage"];
include($includepage);
...

  阅读全文

posted @ 2009-08-20 08:52 bestmost 阅读(2097) | 评论 (0)  编辑

UTF8下中文命名文件下载问题
     摘要: 友情链接:http://www.tjcuxiao.com 和http://www.mujiz.cn】
如果$filename是UTF-8编码的,有些浏览器就无法正常处理了。比如把上面那个程序稍稍改一下:
$filename = "中文 文件名.txt";
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $filename);

print "Hello!";
?>
把程序保存成UTF-8编码再访问,IE6下载的文件名就会乱码。 FF3下下载的文件名就只有“中文”两个字。Opera 9下一切正常。

输出的header实际上是这样子:
  阅读全文

posted @ 2009-08-13 16:13 bestmost 阅读(587) | 评论 (0)  编辑

使用webftp上传压缩文件

posted @ 2009-07-05 03:23 bestmost 阅读(693) | 评论 (0)  编辑

strlen、mb_strlen计算中英文混排字符串长度

posted @ 2009-07-02 14:26 bestmost 阅读(547) | 评论 (0)  编辑

剖析PHP中的输出缓冲

posted @ 2009-06-23 10:11 bestmost 阅读(568) | 评论 (0)  编辑

php图像函数大举例(非原创)

posted @ 2009-06-15 18:14 bestmost 阅读(712) | 评论 (0)  编辑

PHP的COOKIE设置为浏览器进程

posted @ 2009-06-15 17:15 bestmost 阅读(565) | 评论 (0)  编辑

PHP控制输出缓存详解

posted @ 2009-06-10 16:25 bestmost 阅读(646) | 评论 (0)  编辑

ie6下动态缩略图不显示的原因

posted @ 2009-06-10 16:06 bestmost 阅读(539) | 评论 (0)  编辑

php中session的处理机制

posted @ 2009-06-09 14:10 bestmost 阅读(627) | 评论 (0)  编辑

对文件大小的格式化(有bytes输出KB,MB等等)

posted @ 2009-06-05 14:37 bestmost 阅读(513) | 评论 (0)  编辑

将bmp图片转为jpg等其他任意格式的图片

posted @ 2009-06-03 17:49 bestmost 阅读(554) | 评论 (0)  编辑

php 数组数据结构处理

posted @ 2009-06-02 15:46 bestmost 阅读(561) | 评论 (0)  编辑

php if 判读时要注意的几个小问题

posted @ 2009-05-22 08:45 bestmost 阅读(613) | 评论 (0)  编辑

用PHP读取excel(转)

posted @ 2009-05-19 10:50 bestmost 阅读(709) | 评论 (0)  编辑

php实现excel导入数据库

posted @ 2009-05-18 22:13 bestmost 阅读(116) | 评论 (0)  编辑

PHP-SESSION解惑

posted @ 2009-04-11 11:21 bestmost 阅读(696) | 评论 (0)  编辑

PHP 实现多服务器共享 SESSION 数据

posted @ 2009-04-11 11:13 bestmost 阅读(1588) | 评论 (0)  编辑

register_globals = On,session值的问题

posted @ 2009-04-11 11:08 bestmost 阅读(409) | 评论 (0)  编辑

PHP沉思录之五:Session有效期问题

posted @ 2009-04-11 10:36 bestmost 阅读(751) | 评论 (0)  编辑

利用Curl、socket、file_get_contents POST数据

posted @ 2009-03-31 11:05 bestmost 阅读(827) | 评论 (0)  编辑

php如何取得数组最后一个值的小方法

posted @ 2009-03-25 09:27 bestmost 阅读(774) | 评论 (0)  编辑

根据16进制输出所有汉字

posted @ 2009-03-13 11:56 bestmost 阅读(2546) | 评论 (0)  编辑

在PHP里面运用与Perl兼容地正则表达式

posted @ 2009-03-12 10:16 bestmost 阅读(554) | 评论 (0)  编辑

PHP Perl兼容正则表达式 和 POSIX扩展表达式

posted @ 2009-03-11 16:11 bestmost 阅读(828) | 评论 (0)  编辑

php正则表达式中的模式修正符

posted @ 2009-03-05 13:52 bestmost 阅读(557) | 评论 (0)  编辑

php exit 函数的一个Notice

posted @ 2009-03-03 14:09 bestmost 阅读(600) | 评论 (0)  编辑

$GLOBALS 有趣现象
     摘要: function test() {
$c = 2;
}
$a = 1;
$b = 2;

?>
上边的代码的$a和$b都在$GLOBALS里,与$GLOBALS['a']和$GLOBALS['B']是等价的,如下可知:
// 例子2
function test() {
$c = 2;
$GLOBALS['a'] = 'DDD';

}
$a = 1;
$b = 2;

test();

print $a;//此时输出的是DDD而不是1.
?>

有趣的是:$GLOBALS变量又是$GLOBALS变量的值,你会发现$GLOBALS 下有$GLOBALS,这个$GLOGALS下又有$GLOBALS,这样一直层层不断的套下去,很是有趣。
  阅读全文

posted @ 2009-02-27 13:53 bestmost 阅读(758) | 评论 (0)  编辑

可变变量的notice错误

posted @ 2009-02-03 10:54 bestmost 阅读(431) | 评论 (0)  编辑

对php5 static/const关键字的理解

posted @ 2009-02-01 10:14 bestmost 阅读(543) | 评论 (0)  编辑

搜索引擎技术核心揭密PHP版

posted @ 2009-01-20 17:15 bestmost 阅读(669) | 评论 (0)  编辑

jQuery/Ajax/PHP/Json 的一个综合例子

posted @ 2009-01-20 14:26 bestmost 阅读(2461) | 评论 (0)  编辑

php性能效率优化(转)

posted @ 2009-01-14 15:21 bestmost 阅读(470) | 评论 (0)  编辑

Full php模块和类库 Archive

<2010年3月>
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

导航

统计

公告

留言簿(6)

随笔分类(322)

all

搜索

积分与排名

最新评论

阅读排行榜

千百亿工作室
BT促销网