Fejl i søgescript!
Er der nogen der kan følge fejl i følgende script?:<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<title>Caturn</title>
<link rel=\"stylesheet\" href=\"../style.css\" type=\"text/css\">
</head>
<body>
<center><big>Caturn Søg</big></center><hr>
<form method=\"post\" action=\"index.php\">
<input type=\"text\" name=\"search\"> <input type=\"submit\" value=\"Søg\">
</form>
<?
if ($search) {
$m1 = file(\"http://www.caturn.f2s.com/soeg/keyword1.txt\");
$t = count($m1);
for ($i = 0 ; $i < $t ; $i++) {
$c = $m1[$i];
if ($search == $c) {
$n = file(\"http://www.caturn.f2s.com/soeg/titel.txt\");
$d = file(\"http://www.caturn.f2s.com/soeg/beskriv.txt\");
$a = file(\"http://www.caturn.f2s.com/soeg/adresse.txt\");
?>
<table border=\"1\">
<tr>
<td>
<b><? echo $n[$i]; ?></b><br>
<? echo $d[$i]; ?><p>
<a href=\"<? echo $a[$i]; ?>\">Gå til siden</a>
</td>
</tr>
</table>
<?
}
if ($search != $m1[$i]) {
$l++;
}
}
$m2 = file(\"http://www.caturn.f2s.com/soeg/keyword2.txt\");
$t = count($m2);
for ($i = 0 ; $i < $t ; $i++) {
$c = $m2[$i];
if ($search == $c) {
$n = file(\"http://www.caturn.f2s.com/soeg/titel.txt\");
$d = file(\"http://www.caturn.f2s.com/soeg/beskriv.txt\");
$a = file(\"http://www.caturn.f2s.com/soeg/adresse.txt\");
?>
<table border=\"1\">
<tr>
<td>
<b><? echo $n[$i]; ?></b><br>
<? echo $d[$i]; ?><p>
<a href=\"<? echo $a[$i]; ?>\">Gå til siden</a>
</td>
</tr>
</table>
<?
}
if ($search != $m2[$i]) {
$l++;
}
}
$m3 = file(\"http://www.caturn.f2s.com/soeg/keyword3.txt\");
$t = count($m3);
for ($i = 0 ; $i < $t ; $i++) {
$c = $m3[$i];
if ($search == $c) {
$n = file(\"http://www.caturn.f2s.com/soeg/titel.txt\");
$d = file(\"http://www.caturn.f2s.com/soeg/beskriv.txt\");
$a = file(\"http://www.caturn.f2s.com/soeg/adresse.txt\");
?>
<table border=\"1\">
<tr>
<td>
<b><? echo $n[$i]; ?></b><br>
<? echo $d[$i]; ?><p>
<a href=\"<? echo $a[$i]; ?>\">Gå til siden</a>
</td>
</tr>
</table>
<?
}
if ($search != $m3[$i]) {
$l++;
}
}
$m4 = file(\"http://www.caturn.f2s.com/soeg/keyword4.txt\");
$t = count($m4);
for ($i = 0 ; $i < $t ; $i++) {
$c = $m4[$i];
if ($search == $c) {
$n = file(\"http://www.caturn.f2s.com/soeg/titel.txt\");
$d = file(\"http://www.caturn.f2s.com/soeg/beskriv.txt\");
$a = file(\"http://www.caturn.f2s.com/soeg/adresse.txt\");
?>
<table border=\"1\">
<tr>
<td>
<b><? echo $n[$i]; ?></b><br>
<? echo $d[$i]; ?><p>
<a href=\"<? echo $a[$i]; ?>\">Gå til siden</a>
</td>
</tr>
</table>
<?
}
if ($search != $m4[$i]) {
$l++;
}
}
$m5 = file(\"http://www.caturn.f2s.com/soeg/keyword5.txt\");
$t = count($m5);
for ($i = 0 ; $i < $t ; $i++) {
$c = $m5[$i];
if ($search == $c) {
$n = file(\"http://www.caturn.f2s.com/soeg/titel.txt\");
$d = file(\"http://www.caturn.f2s.com/soeg/beskriv.txt\");
$a = file(\"http://www.caturn.f2s.com/soeg/adresse.txt\");
?>
<table border=\"1\">
<tr>
<td>
<b><? echo $n[$i]; ?></b><br>
<? echo $d[$i]; ?><p>
<a href=\"<? echo $a[$i]; ?>\">Gå til siden</a>
</td>
</tr>
</table>
<?
}
if ($search != $m5[$i]) {
$l++;
}
}
if ($l == count($m1) + count($m2) + count($m3) + count($m4) + count($m5)) {
echo \"Dit søgeord gav ingen resultater!\";
}
}
?>
</body>
</html>