when i try to filter all these parameters php only enters in the first if conditions, ignoring all others conditions.
if($t_red<0){
$t_red=0;
}
else if($
Probably best suited if ran through a filtering function.
function setParam($param) {
if($param < 0) {
$param = 0;
} elseif($param > 256) {
$param = 255;
}
return $param;
}
$t_green = setParam($t_green);
$t_red = setParam($t_red);
$t_blue = setParam($t_blue);
You could also use pass-by-reference if necessary.