Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[4012f8]: kp / index.php Maximize Restore History

Download this file

index.php    40 lines (39 with data), 1.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
<title>KeePass for J2ME</title>
</head>
<body>
<?
$error = null;
$jadpath = '/files/keepassj2me.jad';
$jarpath = '/files/keepassj2me.jar';
$jad = file_get_contents('..'.$jadpath);
if ($jad) {
if (preg_match('/MIDlet-Version:\\s*([\\d\\.]+)/', $jad, $mm)) {
$version = $mm[1];
if (preg_match('/MIDlet-Jar-Size:\\s*([\\d]+)/', $jad, $mm)) {
$size = intval($mm[1]);
if (filesize('..'.$jarpath) != $size) {
$error = 'Midlet incorrect. Come back later.';
};
} else {
$error = 'Midlet description incorrect. Come back later.';
};
} else {
$error = 'Midlet description incorrect. Come back later.';
};
} else {
$error = 'Midlet description not available. Come back later.';
};
if (is_null($error)) {
?>
<a href="http://<?=htmlspecialchars($_SERVER['HTTP_HOST'].$jadpath)?>">Install Keepass for J2ME <?=$version?></a>
<?
} else {
?>
Error: <?=htmlspecialchars($error)?>
<?
};
?>
</body>
</html>