Hi there again people,
I looks like this thread turned into a 'include' usage
discussion. Well, nothing wrong with that.
The conclusion seems to be that ALL level of nested
included inherit current directory reference for
relative paths from the very first script ( that in
$_SERVER[SCRIPT_NAME]
On Wed, 2004-02-11 at 19:36, John W. Holmes wrote:
> If you use echo, then you should use include().
> If you use print, then you should use include " ".
> Unless you use echo(), then you should use include" "
> and if you use print " ", then you should use include().
> Unless you don't want to. :)
On Tue, 2004-02-10 at 21:00, André Cerqueira wrote:
> If it was a function, parenteses would be mandatory hehe
> I prefer no parentheses on include/require/echo/print/..., cant justify
> it with arguments though, its just the style i chose...
>
> What about:
> > if (...) {
> > ...
> > }
> an
If it was a function, parenteses would be mandatory hehe
I prefer no parentheses on include/require/echo/print/..., cant justify
it with arguments though, its just the style i chose...
What about:
> if (...) {
> ...
> }
and:
> if (...)
> {
> ...
> }
I prefer the second, but people find good r
Richard Davey wrote:
include "$dir/file.php"
vs.
include("$dir/file.php")
Both work just fine. The manual includes examples of both methods. So
which do most people consider "the right way" ?
If you use echo, then you should use include().
If you use print, then you should use include " ".
Unles
From: "Alex Hogan" <[EMAIL PROTECTED]>
> Are you saying that it's better not to use relative paths on
include(...)'s,
> require(...)'s and their (x)_once(...) cousins?
>
> That seems awkward to me.
>
> Why would I want to hard code a path, even if I was including additional
> functionality from an
essage-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 10, 2004 1:50 PM
> To: Samuel Ventura; [EMAIL PROTECTED]
> Subject: Re: [PHP] HELP: Nested include(...)'s take relative paths not
> intuitively
>
> From: "Samuel Ventura&quo
From: "Samuel Ventura" <[EMAIL PROTECTED]>
> I have 3 files in nested subdirectories
>
> (1) /test.php
> (2) /subdir1/test.php
> (3) /subdir1/subdir2/test.php
>
> if I call (3) it loops forever in (2) trying to
> including itself.
>
> Is this a bug or a feature?
A feature?
You make a request for
Hello Samuel,
Tuesday, February 10, 2004, 6:55:24 PM, you wrote:
SV> I have 3 files in nested subdirectories
[snip]
SV> Is this a bug or a feature?
Neither, it's just logic really. The include() function sucks
in the file specified, dropping out to HTML mode to do so. The
included file inherit
9 matches
Mail list logo