|
Posted by Michael Phipps on 10/21/78 11:22
> Been up coding for hours now, and having one of those easy problems
> that I can't figure out. I have the following server setup:
>
> /home/jj/public_html/dev/nn.com
>
> Under n.com folder, I have a file:
>
> ext.inc
> config.php
> test.php
>
> I am trying to setup a variable called $root_path that I can set in
> config.php and be used throughout my app (any folder) and still point
> to the root.
>
> In test.php, I have the following lines:
> $root_path = '/dev/nn.com/';
> if (!file_exists($root_path . 'ext.inc'))
> {
> die ('$root_path is wrong.');
> }
>
> And it always errors out. I have tried 'dev/nn.com'. I can't use './'
> because it has to work from a sub-directory. I can't use
> '/home/jj/public_html/dev/nn.com' because this is also used for images
> in template files, so I need a relative link to the web root. Can
> anyone help me with what to set root path to?
>
> Thanks a lot. I am so frustrated!
>
> JJ
$root_path = $_SERVER['DOCUMENT_ROOT'].'/dev/nn.com/';
Navigation:
[Reply to this message]
|