I have a site with a number of shops all of which have their own mini web-site (currently only one index page!) which I want to include the same basic template and information but obviously put in the shops specific address etc.
I have created the following files:
/index.php
/address.php
/shop1/index.php
/shop1/address.php
/shop2/index.php
/shop2/address.php
/themes/theme1/header.php
/themes/theme1/body.php
/themes/theme1/footer.php
... a bit more complcated than that but you will understand my struture from the above.
The code for shop1/index.php file is:
<?php
global $site_url, $site_shop;
$site_url='http://www.mysite.com';
$site_shop='shop1';
include $site_url.'/themes/theme1/header.php';
include $site_url.'/themes/theme1/page.php';
include $site_url.'/themes/theme1/footer.php';
?>
The above works - the header.php, page.php and footer.php display information as I am expecting but then I want page.php to add in the address details from each shop's address.php file which is where the problem occures:
Code for page.php is:
... some HTML formatting
<?php
include $site_url . '/' . $site_shop . '/' $site_shop .'/address.php';
?>
... more HTML formatting
Code for address.php is:
... just some HTML formatting
I can not get the page.php to include the shop's address as the $site_url and $site_shop variables are not being passed to page.php - what am i doing wrong?