Can anyone tell me where to start with this:
I am wanting to upload images to more than one domain - all domains are on the same server.
I currently have php code which uploads 1 image at a time to just one folder and resizes the image to 640 x 480 px and stores the name in a mysql database.
I have 15 domains on the server which all use the same database to reference the image filename but to display the image I have to reference the single folder the images are uploaded to on the one domain.
This means that 14 of the domains are having to link to the single domain with images, to show them.
There are only ever 3 domains that would need to reference an image although the 3 may vary.
To get a better understanding...
domain 1 (town - in (state) domain 11 - in (country) domain 15)
domain 2 (town - in (state) domain 11 - in (country) domain 15)
domain 3 (town - in (state) domain 12 - in (country) domain 15)
domain 4 (town - in (state) domain 12 - in (country) domain 15)
domain 5 (town - in (state) domain 13 - in (country) domain 15)
domain 6 (town - in (state) domain 13 - in (country) domain 15)
domain 7 (town - in (state) domain 13 - in (country) domain 15)
domain 8 (town - in (state) domain 14 - in (country) domain 15)
domain 9 (town - in (state) domain 14 - in (country) domain 15)
domain 10 (town - in (state) domain 14 - in (country) domain 15)
domain 11 (state containing domains 1, 2 - in (country) domain 15)
domain 12 (state containing domains 3, 4 - in (country) domain 15)
domain 13 (state containing domains 5, 6, 7 - in (country) domain 15)
domain 14 (state containing domains 8, 9, 10 - in (country) domain 15)
domain 15 (country containg all (states) and (towns) of all domains
All domains use the same master database.
Currently all images are being uploaded to domain 15/images and domains 1 to 14 have to use the path (http://www.domain15.com/images) to get the images.
Domain 15 will always need all images uploaded.
Some images will belong to one of the (state) domains (11 to 14)
Some images will belong to the (town) domains (1 to 10)
For example an image may belong to (town) domain No2 which means it will also belong to (state) domain No11 and (country) domain No15.
To save domains 1 to 14 having to reference domain 15 all the time to access the image I would like to upload the image to the respective domains too! So each domain can reference its own image.
Further example:
If user is on (country) domain 15 and uploads an image which should also belong on (state) domain 12 and (town) domain 3 then the image gets uploaded to those 3 domains (15,12,3)
Or if user is on (state) domain 12 it gets uploaded to (15,12,3) the same.
Or if user is on (town) domain 3 it gets uploaded to (15,12,3) the same
Basically domain 15 will contain all images
domain 12 would contain all images for domain 12, 3 and 4
domain 3 would contain images for 3 only.
I was wondering if I could pass some kind of variable saying if the domain = domain1.com upload image to domain 1, domain 11 and domain 15.
If domain = domain11.com upload image to domain 11 and domain 15 find out which (town) domain it wants to go to 1 or 2 and upload to correct one.
if domain = domain15.com found out which (state) domain it wants to go to (11 to 14) and upload to correct one and find out which (town) domain it want to go to 1 to 10 and upload to correct one.
Any suggestions would be greatly received.