Should $_POST data be escaped even if there is no database connection?
When handling user input from $_POST data, it is always recommended to escape the data to prevent potential security vulnerabilities such as SQL injection attacks. Even if there is no direct database connection, the escaped data can still be used in other contexts where escaping is necessary, such as outputting to HTML or passing as parameters in functions.
// Escape $_POST data before using it
$escaped_data = array_map('htmlspecialchars', $_POST);