Prevent Cross-Site Scripting attacks by escaping special HTML characters in user input using PHP's htmlspecialchars function.