RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread Ford, Mike [LSS]
On 11 February 2004 00:38, Adam Bregenzer contributed these pearls of
wisdom:

 On Tue, 2004-02-10 at 19:06, Richard Davey wrote:
 This is slightly off-topic, but related to the include()
 function. What is the given standard regarding when you
 should or shouldn't use braces on a function.
 
 [snip]
 
 Both work just fine. The manual includes examples of both
 methods. So which do most people consider the right way ?
 
 I always use parens on function calls, I think it is more
 readable. Also, some syntax highlighters look for it.

So you don't use parens on include?  (Because it's a language construct and
not a function ;)

That's my take on it -- for language constructs such as include, require,
echo, return, which don't require parentheses, I leave them off.  Including
the parens make them look like functions and, as a general rule, they don't
behave like functions, so the parens are misleading.

Mind you, there are exceptions: exit(), for example, is a language construct
but requires the parens (at least, that's what the fine manual appears to
say, and I've not tested it without!).

Cheers!

Mike

-- 
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Alex Hogan
Hi Richard,

 Why not just set a $basedir value somewhere and always use that in an
 include/require function: include $basedir/sub/whatever - then no
 matter where it's called from it'll never be wrong.

That makes sense...

Is it also recommended that an application local config file be used to set
all the globals that will be used throughout?  Right now I'm using the db to
hold all the vars that I want to make available for all apps.  Is this
something that shouldn't be done this way?  Is there a performance factor
that I should be aware of?  The tests I have done so far show an improvement
in the performance from what I am upgrading from, but (that's another
story):-]

alex



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re[4]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello Alex,

Wednesday, February 11, 2004, 3:08:02 PM, you wrote:

AH Is it also recommended that an application local config file be used to set
AH all the globals that will be used throughout?  Right now I'm using the db to
AH hold all the vars that I want to make available for all apps. Is this
AH something that shouldn't be done this way?  Is there a performance factor

When using SQL there will always be overhead that could otherwise be
avoided. Personally I use a file called common.inc which is basically
my global include file - it has nothing but variables I need set (no
functions, etc - they are held elsewhere) and files I need to include.
It sits at the root of my project and is included on every page. It's
the only file that needs to be included.

This is a matter of personal preference though - others will do it
like this, infact that is how .NET works to a degree via the
web.config file, but you may find a way which works best for you.
No-one can say if its wrong or right, but it would definitely be
quicker than a SQL query :)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread John W. Holmes
From: Ford, Mike [LSS] [EMAIL PROTECTED]

 Mind you, there are exceptions: exit(), for example, is a language
construct
 but requires the parens (at least, that's what the fine manual appears to
 say, and I've not tested it without!).

Only if you want to pass an exit value, i.e. exit(101); otherwise just plain
'ole exit; works fine.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[4]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread John W. Holmes
From: Richard Davey [EMAIL PROTECTED]

 Personally I use a file called common.inc which is basically
 my global include file - it has nothing but variables I need set (no
 functions, etc - they are held elsewhere) and files I need to include.
 It sits at the root of my project and is included on every page. It's
 the only file that needs to be included.

I hope you are also denying access to .inc files otherwise we could view
your file as plain text. Same goes for INI files used with parse_ini_file()
that are stored in the webroot.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello John,

Wednesday, February 11, 2004, 3:25:23 PM, you wrote:

JWH I hope you are also denying access to .inc files otherwise we could view
JWH your file as plain text.

Please.. try ;)

I used to call the file common.php until we had a rather large debate
about the correct naming convention for PHP include files on the PHP
Community list where various people convinced me that .inc is the
correct standard for include files.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread John W. Holmes
From: Richard Davey [EMAIL PROTECTED]

 JWH I hope you are also denying access to .inc files otherwise we could
view
 JWH your file as plain text.

 Please.. try ;)

 I used to call the file common.php until we had a rather large debate
 about the correct naming convention for PHP include files on the PHP
 Community list where various people convinced me that .inc is the
 correct standard for include files.

Heh.. I was just giving a heads up, not threatening.

I personally don't care for .inc files that are in the web root. The ways to
deny access to them vary across web servers and platforms, so it makes
distributing your code a hassle. I know the issues with giving it a .php
extension, also, but at least those issues I can control and fix and are not
related to the OS or webserver.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[8]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello John,

Wednesday, February 11, 2004, 3:42:39 PM, you wrote:

JWH Heh.. I was just giving a heads up, not threatening.

:)

JWH I personally don't care for .inc files that are in the web root. The ways to
JWH deny access to them vary across web servers and platforms, so it makes
JWH distributing your code a hassle. I know the issues with giving it a .php

True.. except I don't distribute my code. It sits on the servers owned
by the company I work for. I know it's different for others though.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Alex Hogan
How large can that file be?

I have a func.php file that I'm putting all my reusable functions in but I
can see that getting pretty large if this project starts getting eaten up
with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;-)

So how large is too large?  I have about 50 constants and globals right now
and it's probably going to get a little larger.  At what point do you break
up the files for performance versus convenience and maintainability?

I read the article that someone posted the other day about good php coding
practices and found that it contradicted a lot of what I have seen not only
on php.net but in this forum.  Some of what was written though made a
tremendous amount of sense.  Other was just common sense, like not putting
function calls in loops.

I think I need more coffee...

 -Original Message-
 From: Richard Davey [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 11, 2004 9:28 AM
 To: [EMAIL PROTECTED]
 Subject: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not
 int uitively
 
 Hello John,
 
 Wednesday, February 11, 2004, 3:25:23 PM, you wrote:
 
 JWH I hope you are also denying access to .inc files otherwise we could
 view
 JWH your file as plain text.
 
 Please.. try ;)
 
 I used to call the file common.php until we had a rather large debate
 about the correct naming convention for PHP include files on the PHP
 Community list where various people convinced me that .inc is the
 correct standard for include files.
 
 --
 Best regards,
  Richardmailto:[EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re[8]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello Alex,

Wednesday, February 11, 2004, 3:47:09 PM, you wrote:

AH How large can that file be?

How long is a piece of string? :)
It's as long as you need it to be.

AH I have a func.php file that I'm putting all my reusable functions in but I
AH can see that getting pretty large if this project starts getting eaten up
AH with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;-)

Are you using classes? If so that should naturally break your project
down into more meaningful chunks.. i.e. you could have a user class,
an order class, etc etc.

If not then you'll end up with hundreds of functions in a single file
which will become a nightmare, so split them into more sensible groups.

AH So how large is too large?  I have about 50 constants and globals right now
AH and it's probably going to get a little larger.  At what point do you break
AH up the files for performance versus convenience and maintainability?

Bear in mind that it is PHP that has to load and use the file, not the
web browser. So to be honest I would say you can easily fit all of
those constants in a single file - my common include at the moment is
35k.

AH I read the article that someone posted the other day about good php coding
AH practices and found that it contradicted a lot of what I have seen not only
AH on php.net but in this forum.  Some of what was written though made a
AH tremendous amount of sense.  Other was just common sense, like not putting
AH function calls in loops.

There is no standard so you have to find your own middle ground. I
don't know which article you are referring to though. Some things make
sense, some make you think now that's a good idea and others are
just downright stupid. Trust me, you will NEVER find two PHP
developers who do things the *exact* same way. That doesn't mean write
bad, poorly formatted code - it just means no-one can turn around and
tell you it's wrong.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread Samuel Ventura

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] ) that calls them. 

I just wanted to clarify my need, even I know some one
may think it is not a good idea to depend in nested
includes in higher level subdirs for default/inherited
script behaviour.

I came to this question when trying to design a
framework for my personal site with the following
requirements.

1. Full frame integration (for frame I mean same menu,
links, etc.. around the content of a specific seccion,
no the html frame tag)
2. Full modularity of subseccions, it means to me, put
a subseccion in a subdirectory an it should be ready
to go. Of course I need to make some includes standar
for this to work.

All this is cleanly implemented with includes for
inherited defaults up to 1 level of subseccion depth.

Since I want second-level-depth (or subsubseccions)
not to know about what is above them, I came to need
this NESTED includes and that is where all started to
fall apart with the problem I already described.

I will start looking for a diferent aproach.

Thanxs to u all.





















__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Samuel Ventura
Hi there,

I have 3 files in nested subdirectories

(1) /test.php
(2) /subdir1/test.php
(3) /subdir1/subdir2/test.php


(1) contains
//
?php
print hello;
?

(2) and (3) contains
/
?php
include(../test.php);
?

if I call (3) it loops forever in (2) trying to
including itself.

I expected (2) correctly included (1) by taking the
relative path referenced to its current location not
the location of (3) which is including it.

If I rename (1) as test1.php, (2) as test2.php and (3)
as test3.php, then (2) fails to find and open (1).

Is this a bug or a feature?

I didnt find any reference to this in the online
documentation.
 








__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Richard Davey
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 inherits all of the properties of the one that included
it, such as current directory location, variable scope, etc.

The include function doesn't (and cannot) know you're including more
PHP code.

In short, never mess around with ../ in a directory of an include
file, that's pretty bad structure anyway IMHO.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread John W. Holmes
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 (3). The thing to remember/realize is that now all
require(), include(), etc. calls now happen relative to the path of (3). So,
when you include (2), which tries to include ../test.php, it is trying to
include itself again because the include() happens relative to the path of
(3).

include()'s are almost like a cut and paste. If you took the code from (2)
and pasted it into (3) in place of the include(), that's the end result.

This is why I do not use relative paths.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-10 Thread Alex Hogan
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 another file?



 -Original Message-
 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 [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 (3). The thing to remember/realize is that now all
 require(), include(), etc. calls now happen relative to the path of (3).
 So,
 when you include (2), which tries to include ../test.php, it is trying to
 include itself again because the include() happens relative to the path of
 (3).
 
 include()'s are almost like a cut and paste. If you took the code from (2)
 and pasted it into (3) in place of the include(), that's the end result.
 
 This is why I do not use relative paths.
 
 ---John Holmes...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread John W. Holmes
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 another file?

Use whatever you're comfortable with because they both work. I'm just saying
that I stay away from relative includes, myself.

It's easy to just create a variable (or extract the data from $_SERVER) to
find out the absolute path and just use that as a variable. Then you can do
this:

include($_CONF['path'] . '/test.php');

for example. I make similar $_CONF variables for the html root of the site

$_CONF['html'] = 'http://www.bigredspark.com';

so that even the links in my html are full URLs instead of relative links.

To each his own.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-10 Thread Richard Davey
Hello Alex,

Tuesday, February 10, 2004, 8:08:11 PM, you wrote:

AH Are you saying that it's better not to use relative paths on include(...)'s,
AH require(...)'s and their (x)_once(...) cousins?

Relative paths are fine, so long as you have strict control over what
is calling the script and from where. They're not particularly good
coding practise though given the way PHP works.

AH Why would I want to hard code a path, even if I was including additional
AH functionality from another file?

Because if you're including it all over the place from any number of
scripts in any number of locations - the relative directory is always
going to change.

Why not just set a $basedir value somewhere and always use that in an
include/require function: include $basedir/sub/whatever - then no
matter where it's called from it'll never be wrong.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Richard Davey
Hello John,

Tuesday, February 10, 2004, 8:20:50 PM, you wrote:

JWH include($_CONF['path'] . '/test.php');

This is slightly off-topic, but related to the include() function.
What is the given standard regarding when you should or shouldn't
use braces on a function.

For example:

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 ?

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Martin Towell
 Hello John,
 
 Tuesday, February 10, 2004, 8:20:50 PM, you wrote:
 
 JWH include($_CONF['path'] . '/test.php');
 
 This is slightly off-topic, but related to the include() function.
 What is the given standard regarding when you should or shouldn't
 use braces on a function.
 
 For example:
 
 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 ?

This is one of those personal preference things. Pick which ever way you
like the best and stick with it.

Martin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Adam Bregenzer
On Tue, 2004-02-10 at 19:06, Richard Davey wrote:
 This is slightly off-topic, but related to the include() function.
 What is the given standard regarding when you should or shouldn't
 use braces on a function.

[snip]

 Both work just fine. The manual includes examples of both methods. So
 which do most people consider the right way ?

I always use parens on function calls, I think it is more readable. 
Also, some syntax highlighters look for it.

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread John W. Holmes
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  .
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. :)
Like someone else said: Personal preference. There's no right or wrong.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HELP: Nested include(...)'s take relative paths

2004-02-10 Thread André Cerqueira
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 reasons for each of them...



Adam Bregenzer wrote:

On Tue, 2004-02-10 at 19:06, Richard Davey wrote:

This is slightly off-topic, but related to the include() function.
What is the given standard regarding when you should or shouldn't
use braces on a function.


[snip]


Both work just fine. The manual includes examples of both methods. So
which do most people consider the right way ?


I always use parens on function calls, I think it is more readable. 
Also, some syntax highlighters look for it.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] HELP: Nested include(...)'s take relative paths

2004-02-10 Thread Adam Bregenzer
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 (...) {
 ...
   }
 and:
   if (...)
   {
 ...
   }
 
 I prefer the second, but people find good reasons for each of them...

I'm anal about code formatting.  I always use parens with no space
before a function call, put a space before parens for builtin words (if,
while, etc), don't indent case phrases, move multiple arguments that go
over 80 characters to their own lines, and always use the former of the
above methods.  Of course, if I am modifying someone else's code I
*always* use the coding standards already in place.  The most important
thing is to be consistent.  Everybody has their own preference about how
using different coding styles increases or decreases readability, 
however I think what really improves readability is commenting, not
coding style.

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-10 Thread Adam Bregenzer
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. :)

Heh, what if I use print('')? :P

Actually, I use echo(''), even though using single quotes doesn't give
me better performance I like to separate my strings and variables.

I enjoy using echo, it's like a rebellion against printf.

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with include path

2003-02-03 Thread Knut H. Hassel Nielsen
On Sun, 2 Feb 2003, César Aracena wrote:

 Hi all,

 I'm sorry for this re-post, but I do need help with this URGENT...

 I just finished loading the OS to my PC once again, installed and
 configured IIS and then installed PHP 4 but now, every page I try to open
 tells me:

 Failed opening required '/icaam7/lib/stdlib.php'
 (include_path='.;c:\php4\pear')

 even when my php.ini (under Windows folder) tells me that the include_path
 is:

 include_path = .;c:\php\includes;/

 and no matter how I change this line in php.ini, the include_path appears
 to be set ONLY to c:\php4\pear

 Any ideas on how to change that??? Is there another php.ini file around?

Have you compiled PHP to use the PATH to your php.ini, or is it using another
one?

Check to see if there's another php.ini lying around.

-- 
Knut
--
Knut H. Hassel Nielsen, [EMAIL PROTECTED]
Divisional Engineer, Office : ITS 207
IDI NTNU, Sem Saelands vei 7-9
N-7491 Trondheim, Norway
Phone (+47) 73 59 18 46 Fax (+47) 73 59 44 66

And on the seventh day, He exited from append mode.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Help with include path

2003-02-02 Thread César Aracena
Hi all,

I just finished loading the OS to my PC once again, installed and
configured IIS and then installed PHP 4 but now, every page I try to open
tells me:

Failed opening required '/icaam7/lib/stdlib.php'
(include_path='.;c:\php4\pear')

even when my php.ini (under Windows folder) tells me that the include_path
is:

include_path = .;c:\php\includes;/

and no matter how I change this line in php.ini, the include_path appears
to be set ONLY to c:\php4\pear

Any ideas on how to change that??? Is there another php.ini file around?

Thanks in advance
---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel: +54.299.477-4532
Fax: +54.299.477-7773
Cipolletti, Rio Negro
R8324BEG
Argentina




---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Help with include path

2003-02-02 Thread César Aracena
Hi all,

I'm sorry for this re-post, but I do need help with this URGENT...

I just finished loading the OS to my PC once again, installed and
configured IIS and then installed PHP 4 but now, every page I try to open
tells me:

Failed opening required '/icaam7/lib/stdlib.php'
(include_path='.;c:\php4\pear')

even when my php.ini (under Windows folder) tells me that the include_path
is:

include_path = .;c:\php\includes;/

and no matter how I change this line in php.ini, the include_path appears
to be set ONLY to c:\php4\pear

Any ideas on how to change that??? Is there another php.ini file around?

Thanks in advance

---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel: +54.299.477-4532
Fax: +54.299.477-7773
Cipolletti, Rio Negro
R8324BEG
Argentina


---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Help with include path

2003-02-02 Thread John Nichel
Make a php file with nothing but this in it

?php

phpinfo();

?

...and hit that in your browser.  It will tell you the location of the 
ini that it is using.

César Aracena wrote:
Hi all,

I'm sorry for this re-post, but I do need help with this URGENT...

I just finished loading the OS to my PC once again, installed and
configured IIS and then installed PHP 4 but now, every page I try to open
tells me:

Failed opening required '/icaam7/lib/stdlib.php'
(include_path='.;c:\php4\pear')

even when my php.ini (under Windows folder) tells me that the include_path
is:

include_path = .;c:\php\includes;/

and no matter how I change this line in php.ini, the include_path appears
to be set ONLY to c:\php4\pear

Any ideas on how to change that??? Is there another php.ini file around?

Thanks in advance

---
Cesar Aracena
[EMAIL PROTECTED]
http://www.icaam.com.ar
Cel: +54.299.635-6688
Tel: +54.299.477-4532
Fax: +54.299.477-7773
Cipolletti, Rio Negro
R8324BEG
Argentina


---
Soluciones profesionales en
 Internet y Comunicaciones
  http://www.icaam.com.ar






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Help with include path

2003-02-02 Thread John W. Holmes
 I just finished loading the OS to my PC once again, installed and
 configured IIS and then installed PHP 4 but now, every page I try to
open
 tells me:
 
 Failed opening required '/icaam7/lib/stdlib.php'
 (include_path='.;c:\php4\pear')

Since there's a slash at the beginning, it's looking for
c:\icaam7\lib\stdlib.php to require() into the file. Is that right, or
should it be looking relative to the original file?
 
 even when my php.ini (under Windows folder) tells me that the
include_path
 is:
 
 include_path = .;c:\php\includes;/
 
 and no matter how I change this line in php.ini, the include_path
appears
 to be set ONLY to c:\php4\pear
 
 Any ideas on how to change that??? Is there another php.ini file
around?

Did you restart your webserver?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] help with include

2002-01-12 Thread Brian's News

Hi, I need some help with the include function.
I have a phpBB script and want to put the config.inc.php file in a password
protected directory, Easy peasy you might say, and I know it is, but the
problem comes because the password protected directory isn't on the site the
script is on, mainly because the host says I've got to upgrade my account to
use password protected dir's.
I've got one site with a password protected dir available and would like to
put it on there.

Any idea's how to do it would be appreciated.

Many thanks

Brian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with include

2002-01-12 Thread sundogcurt

I think you can use a URL when you specify your value in the include 
statement, can you not?

[EMAIL PROTECTED] wrote:

Hi, I need some help with the include function.
I have a phpBB script and want to put the config.inc.php file in a password
protected directory, Easy peasy you might say, and I know it is, but the
problem comes because the password protected directory isn't on the site the
script is on, mainly because the host says I've got to upgrade my account to
use password protected dir's.
I've got one site with a password protected dir available and would like to
put it on there.

Any idea's how to do it would be appreciated.

Many thanks

Brian






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with include

2002-01-12 Thread Mehmet Kamil ERISEN

I have installed phpBB several times. Your problem should
not be the password protected directory.
The install.php script tries to wright into the config
file.
so, you have to chmod your file and give r/w access to
everybody.
once insallation is completed, then change it the was it
was originally.
if you give me the url, i can better understand your
problem.
erisen
--- Brian's News [EMAIL PROTECTED] wrote:
 Hi, I need some help with the include function.
 I have a phpBB script and want to put the config.inc.php
 file in a password
 protected directory, Easy peasy you might say, and I know
 it is, but the
 problem comes because the password protected directory
 isn't on the site the
 script is on, mainly because the host says I've got to
 upgrade my account to
 use password protected dir's.
 I've got one site with a password protected dir available
 and would like to
 put it on there.
 
 Any idea's how to do it would be appreciated.
 
 Many thanks
 
 Brian
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] help, weird include problem with functions

2001-08-09 Thread Jaxon


can anyone tell me why this doesn't work??
assuming I have these three files:

settings.php is:
?php $bar=someval; ?

page.php is:
?php   
require(settings.php); 
echo $bar from page.php; //this works!!!
include function.php;
?


function.php is:
?php
function foo{
global $bar;
echo $bar from foo; //this does not work!!!
}
foo();
?

for some reason the $bar in function foo() doesn't have a value... :(
calling page.php only returns the $bar from page.php

thanks in advance!
jaxon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]