On Sat, 27 Oct 2001 13:21:58 +0200 impersonator of [EMAIL PROTECTED]
(Tamas Arpad) planted &I saw in php.general:
>> Unfortunately, you can't include FUNCTION() conditionaly (well, you
>> can, but then you can't use it out of this if():). Why only such
>> dumn restriction, PHP developers?
>I thin
> Unfortunately, you can't include FUNCTION() conditionaly (well, you
> can, but then you can't use it out of this if():). Why only such
> dumn restriction, PHP developers?
I think it's only true for php3
I use many many class definitions in php4 that are inluded
conditionally in another classes
I include files in each other all the time, and some of them might call the
same functions (like database functions).
I just use a string in all function declaration with the name of the
functions or set of functions in the file.
if(!$function_test)
{
$function_test=1;
function test()
{
d
On Fri, 26 Oct 2001 20:54:00 -0400 impersonator of [EMAIL PROTECTED]
(Gerard Onorato) planted &I saw in php.general:
>Hi,
>
>Another solution I have used when I have to do conditional includes which
>may cause the same page to be included twice
>
Unfortunately, you can't include FUNCTION() co
:
}
$theFileAlreadyIncluded =1;
depending on the way your coding you may need make the variable global.
Hope this helps.
Gerard
-Original Message-
From: Jason Wood [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 3:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Error: Can't redeclare al
I had the same type of problem. ( i think)
I had one main page (say index.php) that had a bare bones html page. No
functions or anything.
Then i had separate pages that would be included only if i was using them
(like, say, a category.php for displaying categories, then products.php for
showing
6 matches
Mail list logo