You are here: Using Relative Paths With include() « All PHP « IT news, forums, messages
Using Relative Paths With include()

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация