Wow! That was helpfull!
I don't want to start a flame, but you SHOULD read a msg before replying!!
The WHOLE problem was precisely that INCLUDE_ONCE is not doing what it
should, that is, include that file only once!!!

I used to have it working, now I'm reinstalling and using more recent
versions of everything and I've got that problem too... However, I did find
that it happened because I had used the 'auto_prepend_file' directive to
include the same file I was using in 'include_once'; I'm reinstalling
everything today and documenting every step of the way (I've been trying to
do that in the last couple of days, but I did not have time to do it. It
does look as I'll be able to do it today, so I'll be mailing this list with
my steps to installing everything in a windows box later today.

Bye,
  Madruga

-----Original Message-----
From: Ketan [mailto:[EMAIL PROTECTED]]
Sent: quarta-feira, 21 de Março de 2001 21:48
To: JT Graveaud
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] include_once problem...



HI!
There is a problem in your INCLUDED file.
If is defined function my_function() in your my_file.inc, the first INCLUDE
loads the INC file and defines your function. The second INCLUDE command
loads the same INC file with the same FUNCTION - and there is your problem.

All functions can be INCLUDED once only.

Ketan

*********** Puvodni zprava ***********

Dne 19.3.2001 v 23:15 hodin JT Graveaud napsal(a):

>Hi,
>
>I'm using PHP4.0.5-dev on Apache/1.3.17 - under Windows-Me, 
>sorry not on purpose ;( ... ;-)
>
>I have in my script : include_once "my_file.inc";
>and later on in the same script I have an other :
>include_once "my_file.inc";
>
>unfortunately, I have this error:
>Fatal error: Cannot redeclare my_function() in my_file.inc on line xxx
>
>Which means, include_once does not work properly on ... 
>PHP4.0.5 ? Me ? 
>anyone already knows this problem ?
>
>on linux, of course it works perfectly ...
>
>Thanks for any advices.
>
>PS: Otherwise, I know I can use the old method to include once, 
>with a variable, but I'd like to avoid this.
>
>-- 
>PHP Windows 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 Windows 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 Windows 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]

Reply via email to