in reply to validate user's input

Use code tags for your code and read what people have suggested to the almost same question you asked two days ago.