Check remote server for script update

Posted on 2006-04-01
Medium Priority
Last Modified: 2009-12-16
I'm trying to write a function within my opensource script that will check with a remote server (my site) to see if there is a new version of the script being installed on the users server. Ideally, I would like to be able to have the user click a button to automatically transfer the updated script files to their server if there is an update available and then unzip the files on the server.

I've tried several different functions, but nothing has come close. I can't do FTP since I don't want the FTP username/password made available to everyone. I also can't seem to get the two servers to communicate to determine if there is an update in the first place. I've read info about CURL, but it seems like it can be turned off by some webhosts, so it might not work for everyone.

Any help?

Question by:savetheorcas
1 Comment
LVL 49

Accepted Solution

Roonaan earned 2000 total points
ID: 16353592
I have written a function which is quite complicated but is used to synchronise two servers. This however might be some overkill for just a single file.

It is located at http://www.roonaan.nl/pagina14.html and is in Dutch.

Basically the script consists of two files:

runsync.php which is located at the child/slave server, and sync.php which is located at the parent/master server.

runsync.php calls the sync.php which generates a list of md5() hashkeys for all files that need to be synchronized.
runsync.php will match those keys against the hashes of the locally stored files, and will update when necessairy.
The updating is facilitated through the both scripts.

However, although this works, this might be overkill for you.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question