Hello,
I have to set up about 40 gateway/doorway sites for a client. I want to set them up so they can be updated without me having to log into each one every time a change needs to be made.
I have an index page system all worked out so each gateway site can have it's own customized text etc using a single file on the main site.
BUT what I need now is to be able to store a folder with images etc on each of these gateway sites and have this folder of images/files be updated by a folder on the main site.
So lets say I have this folder on the main site:
... and filefolder contains:
image1.jpg
page.html
image2.gif
Now what I'd like to have is a script in each of the 40 gateway sites which would grab the folder "filefolder" from mainsite.com, and make an exact duplicate of that folder in the site the script resides on.
So if I had 3 gateway sites with this script:
www.gateway1.com/getfolder.php
www.gateway2.com/getfolder.php
www.gateway3.com/getfolder.php
... after the script was executed on each one the sites, they would now have an exact duplicate of "filefolder" from mainsite.com...so:
www.gateway1.com/filefolder
image1.jpg
page.html
image2.gif
www.gateway2.com/filefolder
image1.jpg
page.html
image2.gif
www.gateway3.com/filefolder
image1.jpg
page.html
image2.gif
Now each time the script (getfolder.php) is run, the script should delete "filefolder" if it exists from the site it's on and again grab and duplicate "filefolder" and it's contents from mainsite.com.
In short:
Execute Script:
www.gateway2.com/getfolder.php
Script Deletes Folder(if exists)
www.gateway2.com/filefolder <- delete
Script Grabs Folder And It's Contents From Main Site
www.mainsite.com/filefolder
Script Duplicates This Folder And It's Contents On It's Gateway Site
www.gateway2.com/filefolder <- create
Does anyone have an idea of how I could go about creating a script that would do this? I mean it sounds simple - copy a folder from one site and duplicate it on another - but I have no experience with creating/delete files and folders with PHP, especially when grabbing the files and folder from a different site.
I've checked several script sites and I can't find anything that does exactly what I'm looking for.
Any help with this would be greatly appreciated!!!!
Peter