$version/

\n\n"; echo "../
\n\n"; $dirs = array(); while ($row = mysql_fetch_array($result)) { if(!in_array($row[pkg_dir], $dirs)) { array_push($dirs, str_replace("/", "",$row[pkg_dir])); echo "$row[pkg_dir]
\n"; } } } elseif(!$location AND $dir != "") { $query = "SELECT pkg_location FROM `tbl_packages` WHERE `pkg_dir`='$dir' AND `ver_name`='$version' ORDER BY pkg_location"; echo "pwd: $version/$dir/

\n\n"; echo "../
\n\n"; $subdirectories = array(); $result = mysql_query($query, $db); while ($row = mysql_fetch_array($result)) { if(!in_array($row[pkg_location], $subdirectories)) { array_push($subdirectories, $row["pkg_location"]); echo "$row[pkg_location]
\n"; } } } elseif($dir != "" AND $location != "") { $location = "/$location"; $query = "SELECT pkg_name, pkg_descr FROM `tbl_packages` WHERE `pkg_dir`='$dir' AND `pkg_location`='$location' AND `ver_name`='$version' ORDER BY pkg_name"; echo "pwd: $version/$dir$subdir

\n\n"; echo "../
\n\n"; $pkgs = array(); $result = mysql_query($query, $db); echo ""; while ($row = mysql_fetch_array($result)) { if(!in_array($row[pkg_name], $pkgs)) { array_push($pkgs, $row[pkg_name]); echo ""; } } echo "
$row[pkg_name]".nl2br(str_replace(" ", " ", htmlspecialchars($row[pkg_descr])))."
"; } } else { if($q == "") { // no arg passed, it means we are going to browse the root echo "pwd: /

../
"; for($i=0;$islackware-$versions[$i]
"; } } else { echo "The query string contained invalid characters."; } } ?>