if ($_POST["action"] == "dell_all") { $filename = "../msgs.txt"; unlink($filename); $handle = fopen($filename, "w+"); header('location:'.$_SERVER['HTTP_REFERER']);