PHP error handling : my code is not optimized
Posted
by Tristan
on Stack Overflow
See other posts from Stack Overflow
or by Tristan
Published on 2010-04-19T12:11:06Z
Indexed on
2010/04/19
12:13 UTC
Read the original article
Hit count: 213
Hello,
I must warn you, this code will heart your eyes, so please don't judge me, i'm trying to improve the way I handle errors
all my tests are like this :
if ($something < 27)
{
$error_IP= '<div class="error_message">something bad</div> ';
}else{
$erreur_IP='';
}
and here's the ugliest thing :
if( !isset($_POST) || ($erreur_captcha !='') || ($erreur_email !='') || ($erreur_hebergeurVide != '') || ($erreur_paysVide != '') || ($erreur_slotVide != '') || ($erreur_rconVide != '') || ($erreur_tick != '') + a lot more :d )
What do you suggest to me to optimize my errors handling ?
Thank you
© Stack Overflow or respective owner