blob: bda03555ae375564e315f8888565d077c6316946 (
plain)
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
|
<?php
// TOUCH NOT LEST YE BE TOUCHED _______________________________
mysql_connect ("localhost","tfarnon","blunderbus"); // lol security
mysql_select_db ("bucky");
$query = mysql_query ("SELECT * FROM `keywords` order by `keyword` asc");
$nrows = mysql_num_rows ($query);
if (!isset ($_GET['s']) || !isset ($_GET['e'])) {
$startIndex = 0;
$endIndex = $nrows;
} else {
$startIndex = $_GET['s'];
$endIndex = $_GET['e'];
}
if ($startIndex != 0) {
$page = ($endIndex - $startIndex); // select a set between _ and _
} else {
$page = $nrows; // select all from _
}
// SET UP STRING BELOW HERE ___________________________________
$rString = "&numItems=" . $page;
for ($i = 0 ; $i <= $endIndex; $i++) {
$row = mysql_fetch_array($query);
$rString .= "&keyword" .$i ."=". $row['keyword'];
if ($row['color']) $rString .= "&color" .$i ."=". $row['color'];
else $rString .= "&color" .$i ."=". "plain";
}
echo $rString;
?>
|