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 Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/ 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. Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/#findComment-545629 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? Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/#findComment-545632 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>'; } Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/#findComment-545636 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. Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/#findComment-545660 Share on other sites More sharing options...
Haggis Posted May 23, 2008 Author Share Posted May 23, 2008 got it working thanks guys Link to comment https://forums.phpfreaks.com/topic/106452-solved-check-for-update/#findComment-547969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.