Are there any potential pitfalls to including HTML files in PHP using the include function?

One potential pitfall of including HTML files in PHP using the include function is that it may expose sensitive information such as database credentials or API keys if not properly secured. To solve this issue, it is recommended to store sensitive information in a separate configuration file outside of the web root directory and include it in the PHP file using the include function.

// config.php
<?php
$db_host = 'localhost';
$db_user = 'username';
$db_pass = 'password';
$db_name = 'database_name';
?>

// index.php
<?php
include('../config.php');

// Rest of the code
?>