Re: Referring to Parent Folders
thx, I'll start using that :)
"Savut" <webki@hotmail. com> wrote in message
news:DI5Wb.4025 $sO4.599364@new s20.bellglobal. com...[color=blue]
> Because include() use physical path and not your website root path (html).
> You have to use the full physical path, something like
> include("C:/wwwroot/user1/dom1/public_html/php/script.php") on windows or
> include("/home/user1/dom1/public_html/php/script.php") on linux. But to[/color]
be[color=blue]
> simpler, you can also use the variable $_SERVER["DOCUMENT_R OOT"] which
> return the physical up to your root.
>
> include($_SERVE R["DOCUMENT_R OOT"] . "/php/script.php");
>
> Note: This is not a problem as this way, you can include any file[/color]
everywhere[color=blue]
> on the system (unprotected). Also it's also applied to ASP-VBS and others
> languages.
>
> Savut
>[/color]
Referring to Parent Folders
Collapse
This topic is closed.
X
X
-
Guest replied -
Guest repliedRe: Referring to Parent Folders
Because include() use physical path and not your website root path (html).
You have to use the full physical path, something like
include("C:/wwwroot/user1/dom1/public_html/php/script.php") on windows or
include("/home/user1/dom1/public_html/php/script.php") on linux. But to be
simpler, you can also use the variable $_SERVER["DOCUMENT_R OOT"] which
return the physical up to your root.
include($_SERVE R["DOCUMENT_R OOT"] . "/php/script.php");
Note: This is not a problem as this way, you can include any file everywhere
on the system (unprotected). Also it's also applied to ASP-VBS and others
languages.
Savut
"Vinny" <hctimo787@yaho o.com> wrote in message
news:tQ_Vb.2032 2$GO6.14303@new sread3.news.atl .earthlink.net. ..[color=blue]
> I don't know if this is a PHP config problem, or an Apache 1.3/PHP 4
> problem, or what. When I include a script, say 2 folders up in the
> structure, I'm having to move up to it instead of skipping to root and
> moving down to it. Allow me to clarify, let's say my tree structure looks
> like so [brackets indicate folder]:
>
> [doc root]
> -----[php]
> ---------- script.php
> ---------- [some folder]
> --------------- [another folder]
> -------------------- current.php
>
> Let's then say that I want to include 'script.php' inside 'current.php'.[/color]
As[color=blue]
> it is now, I'm having to use include('../../script.php'). This is[/color]
obviously[color=blue]
> a nuisance, especially if I want to move things around. Now, I remember[/color]
in[color=blue]
> the past (different server config), using include('/php/script.php') would
> work perfectly fine, but it does NOT work now, and I'd love for it to[/color]
work.[color=blue]
> Using /folder/file.ext works in regular HTML so I can only assume it is[/color]
not[color=blue]
> a problem with Apache. So my question is, is this simply a PHP config
> problem?
>
> PHP 4.3.4
> Apache 1.3.something
>
> Thanks!!!!!
>
> Vinny
>
>
>
>[/color]
Leave a comment:
-
Guest repliedRe: Referring to Parent Folders
Vinny wrote:[color=blue]
> I don't know if this is a PHP config problem, or an Apache 1.3/PHP 4
> problem, or what. When I include a script, say 2 folders up in the
> structure, I'm having to move up to it instead of skipping to root and
> moving down to it. Allow me to clarify, let's say my tree structure looks
> like so [brackets indicate folder]:
>
> [doc root]
> -----[php]
> ---------- script.php
> ---------- [some folder]
> --------------- [another folder]
> -------------------- current.php
>
> Let's then say that I want to include 'script.php' inside 'current.php'. As
> it is now, I'm having to use include('../../script.php'). This is obviously
> a nuisance, especially if I want to move things around. Now, I remember in
> the past (different server config), using include('/php/script.php') would
> work perfectly fine, but it does NOT work now, and I'd love for it to work.
> Using /folder/file.ext works in regular HTML so I can only assume it is not
> a problem with Apache. So my question is, is this simply a PHP config
> problem?[/color]
look at your include_path
HTH
Bruno
Leave a comment:
-
Referring to Parent Folders
I don't know if this is a PHP config problem, or an Apache 1.3/PHP 4
problem, or what. When I include a script, say 2 folders up in the
structure, I'm having to move up to it instead of skipping to root and
moving down to it. Allow me to clarify, let's say my tree structure looks
like so [brackets indicate folder]:
[doc root]
-----[php]
---------- script.php
---------- [some folder]
--------------- [another folder]
-------------------- current.php
Let's then say that I want to include 'script.php' inside 'current.php'. As
it is now, I'm having to use include('../../script.php'). This is obviously
a nuisance, especially if I want to move things around. Now, I remember in
the past (different server config), using include('/php/script.php') would
work perfectly fine, but it does NOT work now, and I'd love for it to work.
Using /folder/file.ext works in regular HTML so I can only assume it is not
a problem with Apache. So my question is, is this simply a PHP config
problem?
PHP 4.3.4
Apache 1.3.something
Thanks!!!!!
Vinny
Tags: None
Leave a comment: