Re: include_once problem...
| From: | Ketan | Date: | Wed, 21 Mar 2001 21:48:29 +0000 |
| Subject: | Re: include_once problem... | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-6205@lists.php.net to get a copy of this message | ||
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: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net