What are the potential issues with using "include" to embed HTML files in PHP pages?

Using "include" to embed HTML files in PHP pages can potentially expose your website to security risks, such as code injection attacks. To prevent this, it is important to ensure that the included files are validated and sanitized before being included in the PHP page. One way to do this is by using the "htmlspecialchars" function to escape any special characters in the included file.

<?php
// Include the HTML file with proper validation
$included_file = 'path/to/your/html/file.html';
if (file_exists($included_file)) {
    $content = file_get_contents($included_file);
    echo htmlspecialchars($content);
} else {
    echo 'Error: File not found';
}
?>