if ($data1['cheker'] == '-1'){
$f = fopen('photo.txt', 'a+');
$tmp_mass = file('photo.txt', FILE_IGNORE_NEW_LINES);
$file_name = $tmp_mass[0];
fclose($f);
$dir = "avatars/";
unlink($dir.$file_name);
$f = fopen('photo.txt', 'w');
fclose($f);
header('Location: /profile.php');
}