What is wrong here? $actual_id = ($_GET['category_id']); // line 1 , here is the error, but what? :) if($actual_id){ $finded = false; for($a = 0; $a < count($first_level) && !$finded; $a++){ if($first_level[$a]["id"] == $actual_id) $finded = true; } if(!$finded){ for($b = 0; $b < count($second_level) && !$finded; $b++){ if($second_level[$b]["id"] == $actual_id){ $finded = true; $actual_id = $second_level[$b]["parent"]; } } } if(!$finded) $actual_id = $first_level[0]["id"]; }else{ $actual_id = $first_level[0]["id"]; } PHP:
I think your PHP configuration is set so that even E_NOTICE errors are shown, I suggest you use this code $actual_id = (isset($_GET['category_id']) && $_GET['category_id']); PHP: instead of $actual_id = ($_GET['category_id']); PHP: FYI: * You need to do something similar with the line {{{ $actual_id = $first_level[0]["id"]; }}} * showing E_NOTICE is a good practice when on a development environment