> Robby,
>
> I just enabled log_errors locally. No errors (as I thought).
>
> Since I am hacking a previously written site, the problem seems to arise
most
> when accessing his pre-built functions across pages. For instance, he uses
a
> 'cards.php' to store all display functions -- showleft() -- showcentre() ,
as
> well as the connect() function.


Hi Andre,

make sure to use require_once for all includes. This will make sure to only
include each file once and will trigger a fatal error if the file cannot be
found because of a wrong path or whatever.

Hope this helps, Torsten Roehr


> Since its a persistent connection -- he opens
> the db once, then performs various queries in it. However, since
'cards.php'
> has already been called once by a page that might require both showleft()
and
> showcentre() -- it barfs and says that it cannot 'redeclare' the
showleft()
> function that has already been declared??  That is really some weird --
> particularly when it works so well (as expected) locally - and also since
I'm
> not 'redeclaring' but calling it for use!
>
> I cannot fathom why the production site would give this error. Perhaps I
need
> to do absolute paths for all headers? But it doesn't make sense that a
> function cannot be called many times -- declaring it once, yes, but
calling
> its use?? If that were the case, then one might as well write it out
longhand
> for each use, and forget the concept of 'functions'.
>
> I think I should look at the error logs for the site -- maybe they will
clue
> me in where I should look.
>
> Thanks,
> Andre

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to