Forum Moderators: coopster
<?php include ("header.htm"); ?> but it wont work on the new server. <?php include ("header.htm"); ?>
That's a really unsafe way to do an include.
...the server looks for another header.htm anywhere in the defined system variables. You could end up including something from /tmp for example.
include_path - no other "system variables". The include_path should never include the /tmp folder. If the system has been sufficiently compromised to modify the include_path then there's probably other things to worry about. If there is no header.htm immediately relative to the code being processed, ...
include_path is searched first, before defaulting to the script's directory and the cwd. However, "." is often included as part of the include_path so the current directory ends up being searched early anyway. I've even seen this exploited to include remote code.
or absolute relative path.