What are the potential pitfalls of passing parameters to included PHP files?

Passing parameters to included PHP files can lead to potential security risks, such as injection attacks if the parameters are not properly sanitized. To mitigate this risk, always validate and sanitize any parameters passed to included files to prevent malicious code execution.

// Example of including a file with sanitized parameters
$param = filter_input(INPUT_GET, 'param', FILTER_SANITIZE_STRING);
include 'included_file.php';