Results 1 to 2 of 2

Thread: [RESOLVED] If statements, check version number

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Resolved [RESOLVED] If statements, check version number

    Hi there people

    Here we go, my program (in VB) executes a website address with variables in the url, these variables are the version numbers of my app, and i need to check to see if the current version is higher then the version from the users application

    Here is what i have already

    Code:
    <?php
    $usermajor = $_GET["major"];
    $userminor = $_GET["minor"];
    $userrevision = $_GET["revision"];
    
    $major = "2";
    $minor = "0";
    $revision = "354";
    
    
    if($usermajor<$major) {
    
             
    		echo "Update Available: Build " . $major . "." . $minor . "." . $revision;
    		echo "<br><br>";
    		echo "NUMBER !";
    
    
    }elseif($usermajor=$major && $userminor<$minor) {
             
    		echo "Update Available: Build " . $major . "." . $minor . "." . $revision;
    		echo "<br><br>";
    		echo "Click here to update, no 2";
    
    
    }elseif($usermajor=$major && $userminor=$minor && $userrevision<$revision) {
    
             
    		echo "Update Available: Build " . $major . "." . $minor . "." . $revision;
    		echo "<br><br>";
    		echo "Click here to update no 3";
    }else {
    		echo "No updates";}
    
    
    
    
    ?>
    If major is higher the usermajor then it updates regardless
    If major is the same but minor is higher then update
    if major and minor are the same as their counterparts, and revision is higher then update

    But it doesnt seem to work?

    Can any one assist?>

    Thanks, ILMV
    My Flickr Stream


    My Sites Blog Twitter Flickr

  2. #2

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: If statements, check version number

    Ah i see,

    i needed == instead of =

    Thanks ILMV :S

    (shame i cant rep myself)
    My Flickr Stream


    My Sites Blog Twitter Flickr

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