summaryrefslogtreecommitdiff
path: root/tools/bddb/brlog.php
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:27:18 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-12 23:27:18 +0200
commitd992daf99d1ce39ee18b353b67fdfa181d83fbff (patch)
treea9b5f98b73706e024bc7cd7a14ca2674bd75a55c /tools/bddb/brlog.php
parentf9d77ed38031fa29d1495bf3cfee385450463f5b (diff)
downloadu-boot-imx-d992daf99d1ce39ee18b353b67fdfa181d83fbff.zip
u-boot-imx-d992daf99d1ce39ee18b353b67fdfa181d83fbff.tar.gz
u-boot-imx-d992daf99d1ce39ee18b353b67fdfa181d83fbff.tar.bz2
Update Hymod Board Database PHP code in "tools" directory
Patch by Murray Jensen, 01 Jul 2005
Diffstat (limited to 'tools/bddb/brlog.php')
-rw-r--r--tools/bddb/brlog.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/bddb/brlog.php b/tools/bddb/brlog.php
index e95d694..fccfbd0 100644
--- a/tools/bddb/brlog.php
+++ b/tools/bddb/brlog.php
@@ -10,8 +10,9 @@
pg_head("$bddb_label - Browse Board Log");
- if (!isset($serno) || $serno == 0)
- die("serial number not specified!");
+ $serno=intval($serno);
+ if ($serno == 0)
+ die("serial number not specified or invalid!");
function print_cell($str) {
if ($str == '')
@@ -55,16 +56,16 @@
<hr></hr>
<p></p>
<?php
- $limit=abs(isset($limit)?$limit:20);
- $offset=abs(isset($offset)?$offset:0);
+ $limit=abs(isset($_REQUEST['limit'])?$_REQUEST['limit']:20);
+ $offset=abs(isset($_REQUEST['offset'])?$_REQUEST['offset']:0);
$lr=mysql_query("select count(*) as n from log where serno=$serno");
$lrow=mysql_fetch_array($lr);
if($lrow['n']>$limit){
$preoffset=max(0,$offset-$limit);
$postoffset=$offset+$limit;
echo "<table width=\"100%\">\n<tr align=center>\n";
- printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
- printf("<td><%sa href=\"%s?serno=$serno&offset=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
+ printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"&lt;\" src=\"/icons/left.gif\"></a></td>\n", $offset>0?"":"no", $PHP_SELF, $preoffset);
+ printf("<td><%sa href=\"%s?submit=Log&serno=$serno&offset=%d\"><img border=0 alt=\"&gt;\" src=\"/icons/right.gif\"></a></td>\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset);
echo "</tr>\n</table>\n";
}
mysql_free_result($lr);