Hi...
Ich habe ein Suchskript und habe ein Problem. Ich will per Inlcude oder Require meine Datei config.inc.php einbinden. Leider funktioniert das nicht. Kein Plan warum, habe schon alles mögliche versucht. Hier mein Code, hoffe ihr wisst die Stelle, an die ich die Datei einbinden kann.
Ich habe ein Suchskript und habe ein Problem. Ich will per Inlcude oder Require meine Datei config.inc.php einbinden. Leider funktioniert das nicht. Kein Plan warum, habe schon alles mögliche versucht. Hier mein Code, hoffe ihr wisst die Stelle, an die ich die Datei einbinden kann.
PHP-Code:
<?
if(empty($search)) {$search=$_POST[search];}
if(strlen($search) < "3")
{
echo "
<table bgcolor=$border_01 border=0 cellPadding=2 cellSpacing=0 width=$border_01_width>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=5 cellSpacing=0 width=$border_01_width>
<tr>
<td vAlign=top align=center>
<table bgcolor=#000000 border=0 cellPadding=1 cellSpacing=0 width=100%>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=3 cellSpacing=0 width=100%>
<tr>
<td bgcolor=$color_01 height=5>
</td>
</tr>
<tr>
<td bgcolor=$color_04>
$text_header<b>KEIN ERGEBNISS</b></font>
</td>
</tr>
<tr>
<td>
Geben Sie bitte einen Suchbegriff von mindestens 3 Buchstaben Länge ein.
<p>
<a href=\"javascript:history.back()\">Zurück</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
exit
;
}
$search = strtolower($search);
$found = "0";
$verz = opendir('. ');
while($file = readdir($verz))
{
if($file != "." && $file != ".." && !is_dir($file))
{
$filetype = stristr($file, ".php");
if(!empty($filetype))
{
$string = file_get_contents($file);
$string = strtolower($string);
$string = html_entity_decode($string);
$test = substr_count($string, $search);
if(!empty($test))
{
$fileurl = basename ($file,".php");
$array .= "$test Fundstelle/n <a href=\"http://www.just-older.de/module.php?main=pages/lyrics/$fileurl&main_1=pages/aktu_feat\" target=\"_self\" class=\"link\"> - $file</a><br>";
$found ++;
}
}
}
}
closedir($verz);
if($found!="0")
{
echo "
<table bgcolor=$border_01 border=0 cellPadding=2 cellSpacing=0 width=$border_01_width>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=5 cellSpacing=0 width=$border_01_width>
<tr>
<td vAlign=top align=center>
<table bgcolor=#000000 border=0 cellPadding=1 cellSpacing=0 width=100%>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=3 cellSpacing=0 width=100%>
<tr>
<td bgcolor=$color_01 height=5>
</td>
</tr>
<tr>
<td bgcolor=$color_04>
$text_header<b>SUCHERGEBNISSE</b></font>
</td>
</tr>
<tr>
<td>
Es wurden <strong>$found</strong> Treffer gefunden sortiert nach der Häufigkeit des Vorkommens des Suchbegriffs:<p>";
$daten = array($array);
natsort($daten);
while(list ($line_num, $line) = each($daten))
{
$ausgabe .= "$line";
}
print $ausgabe;
}
if($found == "0")
{
echo "
<table bgcolor=$border_01 border=0 cellPadding=2 cellSpacing=0 width=$border_01_width>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=5 cellSpacing=0 width=$border_01_width>
<tr>
<td vAlign=top align=center>
<table bgcolor=#000000 border=0 cellPadding=1 cellSpacing=0 width=100%>
<tr>
<td>
<table bgcolor=$color_03 border=0 cellPadding=3 cellSpacing=0 width=100%>
<tr>
<td bgcolor=$color_01 height=5>
</td>
</tr>
<tr>
<td bgcolor=$color_04>
$text_header<b>SUCHERGEBNISSE</b></font>
</td>
</tr>
<tr>
<td>
Es wurden leider keine Übereinstimmungen mit dem eingegebenen Suchbegriff gefunden !
<p>
<a href=\"javascript:history.back()\">Zurück</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";}
echo "
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
?>
Kommentar