Suche bei Lexikon Script funktioniert nicht

Zocker4Life

Well-known member
ID: 126615
L
10 Juni 2006
816
35
Ich teste gerade ein Lexikon Script und zwar folgendes:
© ct_lexikon v1.0 powered by computer-tipps.net

Wenn ich nun z.B. etwas suchen möchte, wie test, und es gibt einen Eintrag der genau so heist, kommt leider kein Ergebnis.

<?php
include("config.php");
$lang_s = $lang;
include("lang_".$lang.".php");
if ($slid) {
$result = mysql_query("SELECT * FROM ct_lexikon WHERE id='$slid' AND state='1' LIMIT 1");
$ergebnis = mysql_fetch_array($result);
$name = $ergebnis["name"];
$text = $ergebnis["text"];
$title_plus = " - ".$name;
}
?>
<html>
<head>
<title><?php echo $lang["lname"].$title_plus; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Language" content="<?php echo $lang_s; ?>">
<meta name="keywords" content="<?php echo $lang["keys"]; if ($name) echo ", ".$name; ?>">
<meta name="description" content="<?php echo $lang["desc"]; ?>">
<meta name="robots" content="index, follow">
<link rel="stylesheet" type="text/css" href="layout.css" />

</head>
<body><center>
<div id="center">
<div id="banner"></div></a>
<div id="navigation">

<!-- vorher kommt Ihr Design -->
<!-- ct_lexikon powered by Andreas Schroth (computer-tipps.net) 2005 -->
<!-- you're not allowed to remove or change the copyright and the link in the footer! -->
<br><?php
echo $lang["bar"]."<br><br>";
if (!$slid) {
?>
</div>


<h2><?php echo $lang["lname"]; ?></h2><?php echo $lang["ldesc"]; ?><br>
<form method="post" action="index.php?do=search">
<input type="text" name="suche" size="30"> <input type="submit" value="Suchen">
</form>

<br><br>
<a href="add.html"><?php echo $lang["addinfo"]; ?></a><br>
<?php
}
switch ($do) {
default:
if ($bs) {
$bs2 = strtoupper($bs);
if ($bs == "-") {
$where_plus = " AND ((name LIKE '1%') OR (name LIKE '2%') OR (name LIKE '3%') OR (name LIKE '4%') OR (name LIKE '5%') OR (name LIKE '6%') OR (name LIKE '7%') OR (name LIKE '8%') OR (name LIKE '9%'))";
}
else
$where_plus = " AND name LIKE '".$bs."%'";
$result = mysql_query("SELECT * FROM ct_lexikon WHERE state='1'".$where_plus." ORDER BY name");
$nummer = 1;
$null = "00";
echo $lang["separator"];
while ($ergebnis = mysql_fetch_array($result)) {
$num = 0;
$aname = str_replace(" ", "_", $ergebnis["name"]);
$aname = str_replace(".", "", $aname);
$aname = str_replace(",", "", $aname);
$aname = str_replace("!", "", $aname);
$aname = str_replace("?", "", $aname);
$aname = str_replace("/", "", $aname);
echo "<a href=\"baustoff_".$ergebnis["id"]."_".$aname.".html\">";
echo $null.$nummer.".".$ergebnis["name"]."</a><br>";
if ($nummer == 9) {
$null = "0";
}
if ($nummer == 99) {
$null = "";
}
$nummer = $nummer + 1;
}
if ($nummer <= 1)
echo $lang["noentries"];
}
if ($slid) {
$result2 = mysql_query("SELECT * FROM ct_lexikon");

while ($rows = mysql_fetch_array($result2)) {
$name2 = $rows["name"];
if ($name2 != $name) {
$id2 = $rows["id"];
$aname = str_replace(" ", "_", $rows["name"]);
$aname = str_replace(".", "", $aname);
$aname = str_replace(",", "", $aname);
$aname = str_replace("!", "", $aname);
$aname = str_replace("?", "", $aname);
$aname = str_replace("/", "", $aname);
$ersatz = "<a href=\"baustoff_".$rows["id"]."_".$aname.".html\">" . $name2 . "</a>";
$text = str_replace ($name2, $ersatz, $text);
}
}
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"layout.css\" /><h2>".$name."</h2>".$lang["ldesc"]."<br><br>".$lang[\"separator"];
echo "$text<br>";

}
break;
case "add":
echo "<form method=\"post\" action=\"index.php?do=add2\"><table>";
echo "<tr><td>".$lang["formname"]."</td><td><input type=\"text\" name=\"begriff\" size=\"30\"></td></tr>";
echo "<tr><td valign=\"top\">".$lang["formdesc"]."</td><td><textarea name=\"text\" rows=\"5\" cols=\"60\"></textarea></td></tr>";
echo "<tr><td>Autor</td><td><input type=\"text\" name=\"autor\" size=\"30\"></td></tr>";
echo "<tr><td>eMail-Adresse</td><td><input type=\"text\" name=\"email\" size=\"30\"></td></tr>";
echo "<tr><td></td><td><input type=\"submit\" value=\"Absenden\"></td></tr>";
echo "</table></form>";
break;
case "add2":
if ( ($_POST["begriff"] != "") AND ($_POST["text"] != "") AND ($_POST["autor"] != "")) {
$time = time();
$text = htmlspecialchars($_POST["text"]);
$text = nl2br($text);
mysql_query("INSERT INTO ct_lexikon (name, text, date, autor, email) VALUES ('".$_POST["begriff"]."', '".$text."', '".$time."', '".$_POST["autor"]."', '".$_POST["email"]."')");
echo "<br>".$lang["sugsuccess"];
}
else
echo "<br>".$lang["sugerror"];
break;
case "search":
$buffer = mysql_query("SELECT * FROM ct_lexikon WHERE MATCH (name,text) AGAINST ('".$suche."')");
if (mysql_num_rows($buffer) > 0) {
echo "<br>";
while ($buffer2 = mysql_fetch_array($buffer)) {
$aname = str_replace(" ", "_", $buffer2["name"]);
$aname = str_replace(".", "", $aname);
$aname = str_replace(",", "", $aname);
$aname = str_replace("!", "", $aname);
$aname = str_replace("?", "", $aname);
$aname = str_replace("/", "", $aname);
echo "<a href=\"baustoff_".$buffer2["id"]."_".$aname.".html\">".$buffer2["name"]."</a><br>";
}
}
else
echo "<br>".$lang["searchno"];
echo "<!-- pow. b. A. S. ".$suche."-->";

break;
}
?>
<br><br><font size="1" face="Arial"><div align="center"><a href="imp.php">Impressum</a><br><a href="https://www.computer-tipps.net">© ct_lexikon v1.0 powered by computer-tipps.net</a>
<!-- nachher kommt Ihr Design -->
</body>
</html>
 
Zuletzt bearbeitet:
register_globals ? :roll: :yawn:
(wie erwarte ich den Moment, wo überall nur noch PHP6 läuft :pray: )

:arrow: Programmierung / Scripts & Software