dovresti stampare dopo if($check)... quello che ti ho postato sopra per vedere se if($check) tu da true o meno.