hi all i am trying to enable safe mode so i can enable safe mode for a script i am developing but its not working correclty what i am doing wrong this is my code.
echo "<font color=red>SAFE_MODE ONline</font>";
echo "<font color=green>SAFE_MODE OFF still</font>";
What am i doing wrong?
you simply can’t do it from inside of an php-script.
Why not? Because the ini_set command won’t work for “safe-mode” toggling, as safe_mode is a PHP_INI_SYSTEM (system wide setting) and can only be change via php.ini or .htaccess.
Look for “safe_mode” here: http://www.php.net/manual/en/ini.php#ini.list
So your alternatives are:
a) change the global safe_mode setting in php.ini
b) changing it per directory via .htacces (php_value safe_mode off/on)
so for changing it on in the htaccess will enable it for that directory only?
No, because sub-directories also inherit permissions from parents unless they have a HTACCESS of their own.