RE: [PHP] Can't redeclare already declared function
The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time. Kirk -Original Message- From: kenny.hibs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 3:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Can't redeclare already declared function Anyone help with this Fatal error: Can't redeclare already declared function in header.php3 on line 233 The troubl is that there is no line 233 so it must be looking at another page? -- 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] Can't redeclare already declared function
If you're using php4 you can say include_once("include_file_name.php"); (there's also require_once() ) oktay -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 11:18 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Can't redeclare already declared function The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time. Kirk -Original Message- From: kenny.hibs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 3:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Can't redeclare already declared function Anyone help with this Fatal error: Can't redeclare already declared function in header.php3 on line 233 The troubl is that there is no line 233 so it must be looking at another page? -- 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 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] Can't redeclare already declared function
better yet, try include_once() instead of all instances of include(). It will only include a file once, rather than every time you call include() on that path. Nifty feature. -j At 11:17 AM 4/11/2001, Johnson, Kirk wrote: The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time. Kirk -Original Message- From: kenny.hibs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 3:10 AM To: [EMAIL PROTECTED] Subject: [PHP] Can't redeclare already declared function Anyone help with this Fatal error: Can't redeclare already declared function in header.php3 on line 233 The troubl is that there is no line 233 so it must be looking at another page? -- 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] -- [EMAIL PROTECTED] - 0x514DB5CB he who lives these words shall not taste death becoming nothing yeah yeah forever liquid cool -- 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] Can't redeclare already declared function
Thanks to all who suggested using include_once. Maybe it is just me (long FORTRAN background), but the very idea of include_once makes me nervous, and I don't use it. It violates my sense of acceptable design. I would rather design my code such that a file is *really* only included once, if that is what is supposed to happen. I *want* PHP to tell me when something gets included more than once, then I can review the design. Maybe including the file more than once is OK, maybe not. Depends on what else is in the included file. Not an "Extreme Programming" outlook, I admit :) YMMV. The Old Fogey, Kirk -Original Message- From: Jeffrey Paul [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 11, 2001 9:22 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Can't redeclare already declared function better yet, try include_once() instead of all instances of include(). It will only include a file once, rather than every time you call include() on that path. Nifty feature. -j At 11:17 AM 4/11/2001, Johnson, Kirk wrote: The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time. Kirk -- 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]