Files
sld-php-template/config/functions_init.php
2026-04-27 08:48:03 +01:00

22 lines
735 B
PHP

<?php
function error_env($option){
global $env;
if (empty($env)){
$result="<p class='err_env_result'><span>ERROR:</span> Variable '<u>\$env</u>' is empty!</p>";
$help="<p class='err_env_help'>Please insert the correct value in the file 'config/init.php' or leave it to 'generic'</p>";
}else{
$result="<p class='err_env_result'><span>ERROR:</span> The environment '<u>{$env}</u>' not exists!</p>";
$help="<p class='err_env_help'>Please insert the correct value in the file 'config/init.php or leave it to 'generic'</p>";
}
if($option == "result"){
echo $result;
}elseif($option == "help"){
echo $help;
}else{
echo "ERROR: Wrong attribute in declared in the function!";
die;
}
}
?>