function viewsearch($myqsl, $rname) { $bananepath = "/home/groups/banane/htdocs/wwwcopy/Banane/"; ## get info from config script. $confscr = $bananepath . "Documentation/Scripts/wwwdocu_conf.scr"; $db = mysql_connect($myqsl["Server"], $myqsl["User"], $myqsl["Pass"]); mysql_select_db($myqsl["DB"], $db); $webscr = $confscr . " web"; $allout = `{$webscr}`; $out = explode("\n", $allout); $webpath = $out[0]; $querystring = "SELECT * FROM routines WHERE name LIKE '%" . $rname . "%'"; $routines = mysql_query($querystring, $db); $num_rows = mysql_num_rows($routines); $output = ""; switch ($num_rows) { case 0: $output .= "No matches found."; break; case 1: $row = mysql_fetch_array($routines); $exactname = $row["fullpath"]; $output .= viewroutine($myqsl, $exactname); break; default: $output .= "<H1>search results</H1>"; $output .= nameaimtable($routines); } return $output; }
$phppath = $webpath . "Documentation/PHP/"; $picpath = $phppath . "Pics/"; $dbscr = $confscr . " db"; $allout = `{$dbscr}`; $out = explode("\n", $allout); $Myqsl["Server"] = $out[0]; $Myqsl["User"] = $out[2]; $Myqsl["Pass"] = $out[3]; $Myqsl["DB"] = $out[1]; $Myqsl["Table"] = "dirtreetable"; $treeout = MakeTree($Page, $Name, $Myqsl); if (isset($dir)) { $mainout = viewdir($Myqsl, $Page, $dir); } else { if (isset($routine)) { $mainout = viewroutine($Myqsl, $routine); } else { if (isset($search)) { $mainout = viewsearch($Myqsl, $search); } else { $mainout = introtext(); } } } ?> <div class="content"> <?php echo "<a id='linkhome' href='" . $phppath . "mainpage.php'</a>"; ?>