Currently I have all of my main php functions stored in a single file called allfunctions.php. This file is included within the page header.
My problem is when I use ajax to load in a segment of my page elements within this segment require some of the functions from my allfunctions.php file which they obviously can’t access (as far as I know) due to being separately loaded ajax content.
The only solution seems to be to include my file within every bit of ajax I intend to load in. Do I have any other options here or is that how it is generally done or should I just include the functions required within that ajax file?
My solution currently is to declare a php variable right at the top of my index page called $JS and then within each ajax content file I load in I can include the following:-
[CODE]
if(!$JS){
include(“allfunctions.php”);
}
Am I going along the right lines?