Friday, January 07, 2005

PHP File Extension Scope

Just figured this out:

.inc - variables in file have global scope
.php - variables in file have local scope

Seems peculiar. But I just tested it again. And sure enough.

The problem is that .inc files can often be parsed by the browser revealing the code, unless the server is set specifically to prevent it from doing so.

The solution might be a simple key variable that the include checks to make sure is set before proceeding.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home