Code Comments
Programming Forum and web based access to our favorite programming groups.How do I find the path to an include file from inside the file when loaded? The file is located above the doc root. The script which includes the file is located in the doc root. The included file needs to include additional files located in the same directory as itself. I am trying not to have to edit the php.ini include_path or to set it at run-time using set_ini(). Any help would be appreciated. thanks Patrick
Post Follow-up to this messageadvertis wrote: > How do I find the path to an include file from inside the file when > loaded? The file is located above the doc root. The script which includes > the file is located in the doc root. The included file needs to include > additional files located in the same directory as itself. I am trying not > to have to edit the php.ini include_path or to set it at run-time using > set_ini(). > > Any help would be appreciated. thanks realpath(__FILE__) will give you the full real path name to the current file. http://www.php.net/realpath -- Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Post Follow-up to this messageWorks Great! thanks "Chris Hope" <blackhole@electrictoolbox.com> wrote in message news:1098485052_35193@216.128.74.129... > advertis wrote: > includes not > > realpath(__FILE__) will give you the full real path name to the current > file. > > http://www.php.net/realpath > > -- > Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.