MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/public_html/modules/Encyclopedia/search.php
<?php


if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = $name;
include("header.php");

if (isset($query) AND (isset($eid)) AND ($query != "")) {
    $result = sql_query("select tid, title from $prefix"._encyclopedia_text." where eid='$eid' AND title LIKE '%$query%'", $dbi);
    $result2 = sql_query("select title from $prefix"._encyclopedia." where eid='$eid'", $dbi);
    list($ency_title) = sql_fetch_row($result2, $dbi);
    title("$ency_title: "._SEARCHRESULTS."");
    OpenTable();
    echo "<center><b>"._SEARCHRESULTSFOR." <i>$query</i></b></center><br><br><br>"
	."<i><b>"._RESULTSINTERMTITLE."</b></i><br><br>";
    if (sql_num_rows($result, $dbi) == 0) {
        echo _NORESULTSTITLE;
    } else {
	while(list($tid, $title) = sql_fetch_row($result, $dbi)) {
	    echo "<strong><big>&middot</big></strong>&nbsp;&nbsp;<a href=\"modules.php?name=$module_name&op=content&tid=$tid\">$title</a><br>";
	}
    }
    $result = sql_query("select tid, title from $prefix"._encyclopedia_text." where eid='$eid' AND text LIKE '%$query%'", $dbi);
    echo "<br><br><i><b>"._RESULTSINTERMTEXT."</b></i><br><br>";
    if (sql_num_rows($result, $dbi) == 0) {
        echo _NORESULTSTEXT;
    } else {
	while(list($tid, $title) = sql_fetch_row($result, $dbi)) {
	    echo "<strong><big>&middot</big></strong>&nbsp;&nbsp;<a href=\"modules.php?name=$module_name&op=content&tid=$tid&query=$query\">$title</a><br>";
	}
    }
    echo "<br><br>"
	."<center><form action=\"modules.php?name=$module_name&file=search\" method=\"post\">"
	."<input type=\"text\" size=\"20\" name=\"query\">&nbsp;&nbsp;"
	."<input type=\"hidden\" name=\"eid\" value=\"$eid\">"
	."<input type=\"submit\" value=\""._SEARCH."\">"
	."</form><br><br>"
	."[ <a href=\"modules.php?name=$module_name&op=list_content&eid=$eid\">"._RETURNTO." $ency_title</a> ]<br><br>"
	.""._GOBACK."</center>";
    CloseTable();
} else {
    OpenTable();
    echo "<center>"._SEARCHNOTCOMPLETE."<br><br><br>"
	."<center><form action=\"modules.php?name=$module_name&file=search\" method=\"post\">"
	."<input type=\"text\" size=\"20\" name=\"query\">&nbsp;&nbsp;"
	."<input type=\"hidden\" name=\"eid\" value=\"$eid\">"
	."<input type=\"submit\" value=\""._SEARCH."\">"
	."</form><br><br>"
	.""._GOBACK."</center>";
    CloseTable();
}

include("footer.php");

?>