Suppose you have an existing PHP site that depends on the configuration value of
How can you have
You could chalk it up to
You could place the script in a subdirectory and set
That's where Apaches
magic_quotes_gpc being either on or off. Now imagine that you have a small script you want to add to the site that requires magic_quotes_gpc to be the opposite value.How can you have
magic_quotes_gpc be on and off at the same time ?You could chalk it up to
bad programmingand not use the script. But what if it's a good script and the programmer has taken all proper precautions for whichever way they decided to use the
magic_quotes_gpc ?You could place the script in a subdirectory and set
magic_quotes_gpc the way you need it for that script within that subdirectories htaccess using php_flag directives. But what if having the script in a subdirectory will end up complicating things in the scripts template or other areas ?That's where Apaches
<Files/> container comes in. You can use this container inside htaccess or the <VirtualHost/> container of the site to apply php_flag directives only to specific files as shown below.<Files "my-script.php">
php_flag magic_quotes_gpc off
</Files>
Posted by
Joe
at
5:17 PM
1 responses
Labeled/Tagged as: apache htaccess php programming scripting server