Concept Flow - Input validation vs sanitization
User Input Received
Input Validation
Yes / No
Input OK
Input Sanitization
Safe Input Used
First, the program checks if the input meets rules (validation). If yes, it cleans the input (sanitization) before use. If no, it rejects the input.