Posted by Oli Filth on 06/06/05 00:54
Lee David said the following on 05/06/2005 22:49:
> Can you include common code in a script? What I'm looking for is
> eliminating the duplicate connection code to the database so if it ever
> changes I only have to update one place. I put an include where the code
> was, but that resulted in an error.
Would you care to share with us what that error was? Or do we have to guess!
>
> File x.inc
> variable1 = 'fred';
> variable2 = 'ginger';
> variable3 = 'rogers';
>
> File y.php
> include("x.inc");
> if (variable1 == "fred") yada, yada, yada
>
Umm, you're missing <?php and ?>, and $ prefixes to the variables names
(although I know that that isn't real code anyway)...
--
Oli
[Back to original message]
|