Jump to content

[SOLVED] Check for update


Haggis

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.