halojoy, of course I was talking about using PHP tags within a file that ends in ".php" with a server setup to parse ".php" files. I feel most people do not have access to server settings and are using shared hosting. Some web host companies allow overrides using the .htaccess file.
Since this topic switched to security, I have some tips to share. Ideally, you should have all your include files in your root directory or a sub-directory off the root (away from the web public directory). If you can't do that or wish extra protection, then one way to protect your include files from being included from another server/site is to put a little bit of code at the top of every include file to check for this hijacking. You can use $SERVER['SERVER_NAME'] and/or $SERVER['SERVER_ADDR'] to make sure that the include script is only being run from your server.
Another technique, which can be used instead of or with the above technique, is simply to set a variable or constant with a certain value in the main script, and have all the include files look for that before allowing access to the included code. So, each of the include files would have something like this at the top of them:
if ((!defined('SECRET_VAR')) || ('something' != SECRET_VAR))
exit('Access violation. You are not authorized to run this script.');
In order for someone to use your script remotely, they would have to know the variable you used and value before it could be included/used.
When you have configuration files where you use the parse_ini_file() function, and wish to prevent accidentally trying to include the file instead of reading it, do something like this:
; <?PHP exit('Access violation. Do not try and run this script.'); ?>
; Config settings go here...
output = standard
The semi-colon is used as comments for configuration files, but if the script is executed directly, the exit will be invoked.
hth.