I’m fairly new to php development and am in the process of building my first php content managed web site.
I have a main domain which contains most of the php function files ( all included ) and the page templates ( also included ), but i also have a subdomain of this domain that i wish to allow to use the same files.
I have an index.php file at both locations which includes all the function files and adds some variables unique to each domain. This all works fine on the main domain and variables etc are shared between all the includes correctly. However, i have just got round to creating the index file for the sub domain and have found two problems.
Firstly, any variables i set in index.php of the subdomain cannot be found in any of the files i include from the main domain.
Secondly, when i try to call a function from the subdomain that is contained in one of the included files from the main domain the error "Fatal error: Call to undefined function: fn_checkstructureidexists() " appears.
Is the loss of variables and functions across subdomains a security/sandboxing issue? Is there anyway around this? Its getting very frustrating cos it just doesnt make any sence.
Please help / advise! Many thanks!