Added security by checking input value in insert.php. Fixed error where one message was not displaying correctly when data is not available.