What are the best practices for including files in PHP when transitioning to an SSL connection?

When transitioning to an SSL connection in PHP, it is important to ensure that all included files are also loaded securely to prevent any security vulnerabilities. One way to achieve this is by using relative paths or server variables to include files. Additionally, using HTTPS in file paths and ensuring that all included files are also loaded securely can help maintain a secure connection.

// Example of including files securely when transitioning to an SSL connection
include ($_SERVER['DOCUMENT_ROOT'].'/path/to/secure/file.php');