note 6999 deleted from function.include by philip
| From: | philip@php.net | Date: | Fri, 02 Nov 2001 06:49:33 +0000 |
| Subject: | note 6999 deleted from function.include by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20271@lists.php.net to get a copy of this message | ||
php3 will happily include the same file multiple times, which is usually a bad idea. This is why you
should add C-style inclusion-guards in the beginning of inc-files.
<BR>
If you have an inc-file called login.inc, you should do something like this in the
beginning:<BR>
<PRE>
if defined( "LOGIN_INC" )
return;
define( "LOGIN_INC", TRUE );
#code goes here...
...
</PRE>
This way your inc will only be included once.