How to include URL or file in PHP codes
There are 2 scenarios here:
1. To include a PHP file inside hosting space:
Document root: /home/user/public_html/
Index page: /home/user/public_html/index.php
header to be included: /home/user/public_html/include/header.php
Here you can use relative path in index.php:
2. To include a URL in PHP codes:
If the PHP page to be included is an external URL, you would need to enable allow_url_include in PHP.INI. Do note that allowing allow_url_include is a security risk and this is not enabled by default on our shared servers.
allow_url_include only needs to be enabled if it is an external URL and you need to include that in your codes.