Hi, I'm Đạt, your problem is totally easy, to fix that, just adding a piece of ajax to handle the return data that was send to a PHP file, if nothing's wrong, alert the your message, else alert user a suggestion.
Hope to cooperate with you and thank to reading. Nice day!