php没有安全漏洞,呵呵.要注意设置_PHP

WBOY
Release: 2016-06-01 12:25:42
Original
744 people have browsed it

如果你的php.ini中register_globals = On, 所有post, get, cookie, session的同名变量就会搅和在一起,
可以用$HTTP_*_VARS["username"]来判断你想要的那个变量.
但是即使同名, 在php.ini中variables_order = "GPCS"也会按照优先级别来判断, 等级低的值没法冲掉等级高的
所以, 如果一开始就用session_register("username")是明智的, 也可以用session_is_registered来判断变量是否已经注册.
这是一个例子:
if (!session_is_registered("username")) {
    $user_name= "";
    session_register("username");
}
同时保证你的php.ini中, variables_order = "GPCS" (缺省) S即session要放在最后, 优先.
register_globals = On有些浪费系统资源, 在优化配置中被关掉, 这样也避免了出现所谓漏洞.

因为以前碰到过这个问题, 给大家参考一下.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!