Re: Problem with include();
| From: | Raditha Dissanayake | Date: | Sun, 07 Sep 2003 06:14:09 +0000 |
| Subject: | Re: Problem with include(); | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161894@lists.php.net to get a copy of this message | ||
Hello,
It's often said that includes should have relative paths instead of absolute paths. This ensures that your script still works when you move it to a different server. So if an error has forced you to use rel paths consider it a blessing in disguise :-)
Ty Lamb wrote:
/index.php has include("/code/includes/page_header.php"); /docs/aaryn/dmb/dave.php has include("/code/includes/page_header.php"); Both are identical lines of code. Index.php works but dave.php returns the following: Warning: Failed opening '/code/includes/page_header.php' for inclusion (include_path='.;c:\php4\pear') in C:\x\x\x\x\x\aaryn\dmb\dave.php on line 4 but if I change the code in dave.php to include '../../../code/includes/page_header.php'; It works. Why? Is there any way around this? Please tell me I'm doing something wrong and it's not supposed to work like this!!! Ty...-- http://www.radinks.com/upload Drag and Drop File Uploader.