System update check from different server via file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
apoltix
Forum Newbie
Posts: 11
Joined: Fri Sep 30, 2005 3:27 pm
Location: Denmark

System update check from different server via file

Post by apoltix »

I need a file update check for a php-system, where the system gets a file from another server (internet, not intranet), and compares the two file versions defined in the two files, where the first file already lies on the first server, and the second file is the one on the other server.

E.g. file one:

Code: Select all

<?php
$version = "1.0.0.1";
?>
And e.g. file two:

Code: Select all

<?php
$version = "1.0.1.4";
?>
The system then prints a text string (for example) where it says that there's a new version of the system. I've seen this in the phpBB2 code, though I can't "decode" the code in my head, and can't convert it into the correct version I need.

Note, that the system should also print a message, if the system is up-to-date (just add an } else {?)

Anybody that can help me with this one?
roughian
Forum Newbie
Posts: 2
Joined: Sat Oct 29, 2005 5:00 pm

Post by roughian »

<?php
include("file1.php");
$v1=$version;
include("file2.php");
$v2=$version;
echo $v1." ".$v2;
?>
User avatar
apoltix
Forum Newbie
Posts: 11
Joined: Fri Sep 30, 2005 3:27 pm
Location: Denmark

Post by apoltix »

Been there, done that. Doesn't work. It's also supposed to work, if the server is down, and the file can't be included. Then there shouldn't be an error like "could not include" or whatever.
Post Reply