Category Archives: PHP

if echo

$value = 'aaa';
 echo $value=='aaa' ? 'yes' : 'no';

example 1

echo "always say this " . ( ($test == "true") ? 
"Say this if that is true" : "") . " Always say this at the end.";

example 2

echo '<option value="'.$value.'"'.($value=='United States' ? 
'selected="selected"' : '').'>'.$value.'</option>';

PHP Security – disabled the exec, etc.

In /etc/php5/apache2/php.ini

as someone already can upload phpshell it will not do too much…

disable_functions = exec, shell_exec, system, popen, passthru, escapeshellarg, escapeshellcmd, proc_close, proc_open, ini_alter, dl, popen, show_source, set_time_limit, php_uname, phpinfo, diskfreespace, disk_total_space, disk_free_space, get_current_user, posix_uname