'; if (!extension_loaded("sqlite")) { dl("sqlite.so"); } if ($_GET['tag'] != "") { $tag = $_GET['tag']; } if ($_GET['dt'] != "") { $dt = $_GET['dt']; } printf ("\n"); if ($tag && $dt) { // A simple change, to prevent false positives: pad the keywords // field with spaces :) $query = "SELECT * FROM bookmarks where date like '%$dt%' and keywords like '% $tag %'"; } if (!$tag && !$dt) { $query = "SELECT * FROM bookmarks"; } if ($debug) echo ""; if ($db = sqlite_open("/tmp/bookmarks.sqlite", 0666, $err)) { $result = sqlite_query ($db, $query); while (sqlite_has_more($result)) { $post = sqlite_fetch_array ($result); $url = 'href="'.htmlentities($post['url']).'"'; $title = 'description="'.htmlentities($post['title']).'"'; if ($post['desc'] != "") { $desc = 'extended="'.htmlentities($post['desc']).'"'; } else { $desc = ""; } $date = 'time="'.$post['date'].'"'; // Used the wrong variable in the first example $hash = 'hash="'.md5($post['url']).'"'; $tags = 'tag="'.trim($post['keywords']).'"'; print " "; printf ("\n"); } } ?>