error with absolute path for include

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bruceg
Forum Contributor
Posts: 174
Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:

error with absolute path for include

Post by bruceg »

I'm getting an error when trying to preview this include. This is the absolute path to my include file, but I get an error 'failed to open stream, no such file or directory.'

Code: Select all

"<?php include ' c:\inetpub\wwwroot\SSI\footer.htm'; ?>"
could there be an error in the way I have PHP configured? I can post the results from

Code: Select all

<?php phpinfo() ?>
if that would help.

regards,
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Dont include an absolute path - it'll not recognize it.

Code: Select all

include("SSI/footer.htm");
To not to include it more than once in a script :

Code: Select all

include_once("SSI/footer.htm");
If you are calling it from a script in SSI, remove SSI

Code: Select all

include_once("footer.htm");
Post Reply