CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    201

    check version of my script

    Derp.
    Last edited by realchamp; April 5th, 2012 at 12:06 PM.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    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.

  3. #3
    Join Date
    Feb 2009
    Posts
    201

    Re: check version of my script

    Quote Originally Posted by PeejAvery View Post
    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
    }

    ?> 

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    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
  •  





Click Here to Expand Forum to Full Width

Featured