What security measures should be taken when including files in PHP scripts?
When including files in PHP scripts, it is important to ensure that only files from trusted sources are included to prevent security vulnerabilities such as directory traversal attacks. One way to enhance security is by using absolute file paths instead of relative paths when including files.
// Example of including a file using absolute file path
include_once(__DIR__ . '/includes/header.php');