如果你的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有些浪费系统资源, 在优化配置中被关掉, 这样也避免了出现所谓漏洞.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.