Script Version Checker Code

Discussion in 'PHP' started by koolasia, Jan 18, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I Need A Code wch checks the version of the script and tells if a new version is available etc etc
     
    koolasia, Jan 18, 2007 IP
  2. scriptdance

    scriptdance Active Member

    Messages:
    340
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #2
    I think you can just read remote file to get the script version.
     
    scriptdance, Jan 18, 2007 IP
  3. scribby

    scribby Active Member

    Messages:
    497
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #3
    Use something like get_file_contents to get the version off your server from a text file, then use that variable and compare it to the current version number to alert if an update is needed.
     
    scribby, Jan 18, 2007 IP
  4. koolasia

    koolasia Banned

    Messages:
    1,413
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I Did try that got some errors doesnt work that way

    can u post a code instead
     
    koolasia, Jan 18, 2007 IP
  5. Icheb

    Icheb Peon

    Messages:
    1,092
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Why don't you post your code and your errors instead of asking someone who wants to help you to do all the work for you?
     
    Icheb, Jan 18, 2007 IP
  6. scribby

    scribby Active Member

    Messages:
    497
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #6
    Basically should be something like this..

    $thisver = "1.0"; // Version 1.0
    $currentver = get_file_contents("http://yoursite.com/ver.txt"); // Version 1.1
    if ($thisver < $currentver) { // If $thisver is less than $currentver..
    echo "Update Available!";
    }

    Its quite simple really..
     
    scribby, Jan 18, 2007 IP
Thread Status:
Not open for further replies.