Haggis Posted May 20, 2008 Share Posted May 20, 2008 I am making a stats package and i want to be able to if an update is available let the user know how can i use php to check to see if there is an update i cant find anything on the net even to show how to do this Thanks Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 well, you could make a txt file, that has the current version number. and every time an administrator of this package logs into their administrative account, it goes to your web site to check this txt file. In the php, you would check and see what the current version of the package is, and if it is older, that means that theirs is out of date, then you just have them go to your site to download the new package. Quote Link to comment Share on other sites More sharing options...
Haggis Posted May 20, 2008 Author Share Posted May 20, 2008 ok so for example in my script have $ver = 1; then in the text file have 1 then when update it due change it to 1.2 then when the script checks if $ver does not match 1.2 it would pop up a message yeah? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 yeah. so maybe something like this: $ver = 1; /* Replace this block with getting the newest version not all servers support fopen from other sites, so cURL may be the best way to get the newest version. */ $newestV = '1.2'; // this won't always be 1.2, depends on what the text file is if($newestV > $ver){ echo'<script>alert(\'There is a newer version avalible (v'.$newestV.')\');</script>'; } Quote Link to comment Share on other sites More sharing options...
revraz Posted May 20, 2008 Share Posted May 20, 2008 That is exactly how I do it as well. well, you could make a txt file, that has the current version number. and every time an administrator of this package logs into their administrative account, it goes to your web site to check this txt file. In the php, you would check and see what the current version of the package is, and if it is older, that means that theirs is out of date, then you just have them go to your site to download the new package. Quote Link to comment Share on other sites More sharing options...
Haggis Posted May 23, 2008 Author Share Posted May 23, 2008 got it working thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.