You are here: Re: Easy question, I am drawing a blank. « PHP « IT news, forums, messages
Re: Easy question, I am drawing a blank.

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]


Удаленная работа для программистов  •  Как заработать на 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

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