Posted by MBS on 11/16/05 14:07
I am playing around with some PHP code. I want to put in an include()
function so I can include existing HTML code and output it to the browser.
Lo and behold PHP does not support relative paths with the include()
function! (How shortsighted can you get?) Is there any way at all to use
relative paths with include()? Any hacks? If I use an absolute filepath,
everything is fine. But I don't want to do that--I can't do that. I want
to use the filepath relative to the currently executing PHP file.
Somewhere I read something about using an .htaccess file and putting
something in it that will add an "include" for the HTML file I want to
include without me having to change php.ini (I won't have access to php.ini
on the production server anyway.). That way I could just drop it in my
webroot directory and everything would be fine.
Help will be appreciated.
Thanks.
Navigation:
[Reply to this message]
|