|
Posted by Steve on 01/02/06 00:41
On Sat, 31 Dec 2005 21:15:34 +0000, Jim Carlock wrote:
> Any recommendations on the best way to map paths?
>
> require('./library/include/file1.php');
>
> works well for files in the root folder, but for files in another
> folder, I need to rewrite the path to the files, and sometimes
> when testing things on my personal system, they work there,
> but fail when uploaded to the website. Using the root...
>
> require('/library/include/file1.php);
>
> doesn't seem to work as I thought it would. It's like the
> server maps the '/' to something unknown. There a way
> to find out what '/' gets mapped to inside the require()
> function?
>
> Any suggestions? Thanks much.
>
> Messing with PHP 4.4.1 (Windows XP, Apache 1.3.34
> (Win32)) on my system and PHP 4.3.11 (Unix-Apache
> 1.3.31) on the host.
>
> Jim Carlock
> Post replies to the newsgroup.
require ( $_SERVER['DOCUMENT_ROOT'] . "/library/include/file1.php" );
will allow you to access anything under docroot, which is probably the
only stuff you can be sure of when on a shared server.
Steve
Navigation:
[Reply to this message]
|