What are the potential pitfalls of using include("http://...") in PHP scripts and how can they be avoided?

Using include("http://...") in PHP scripts can introduce security risks such as remote code execution and exposing sensitive information. To avoid these pitfalls, it is recommended to use include with local file paths instead of URLs.

// Avoid using include with URLs
include("http://example.com/file.php");

// Instead, use include with local file paths
include("/path/to/file.php");