|
-
October 12th, 2009, 08:31 AM
#1
check version of my script
Last edited by realchamp; April 5th, 2012 at 12:06 PM.
-
October 12th, 2009, 09:35 AM
#2
Re: check version of my script
Have you echoed the two defined variables within the function to make sure they are retrieving the correct strings?
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
October 12th, 2009, 03:51 PM
#3
Re: check version of my script
 Originally Posted by PeejAvery
Have you echoed the two defined variables within the function to make sure they are retrieving the correct strings?
Never mind. I changed abit and eventually it worked 
PHP Code:
define('REMOTE_VERSION', 'http://domain.com/version.txt');
// this is the version of the deployed script $current_version = "1.0.0"; $remoteVersion = trim(file_get_contents(REMOTE_VERSION));
if($remoteVersion == $current_version) { // yes } elseif($remoteversion < $current_version) { // no }
?>
-
October 12th, 2009, 04:16 PM
#4
Re: check version of my script
Unfortunately, that isn't going to do what you need. Because comparison will only work to the first decimal point. If you plan to do it that way, convert each period to a zero.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|