fixed warning if text is false.

This commit is contained in:
Stefan Brannfjell 2013-08-31 13:38:40 +02:00
parent 3082c27bc8
commit af09b01f59

View File

@ -16,10 +16,11 @@ $type = getValue($_GET['type']);
if ($type !== false) $type = (int)$type;
$text = getvalue($_GET['text']);
$text = explode(' ', $text);
$textTitleSql = "";
$textPostSql = "";
$textAuthorSql = "";
if ($text !== false) {
$text = explode(' ', $text);
for ($i = 0; $i < count($text); $i++) {
if ($i != count($text) -1) {
$textTitleSql .= "`title` LIKE '%". $text[$i] ."%' AND ";
@ -31,8 +32,8 @@ for ($i = 0; $i < count($text); $i++) {
$textAuthorSql .= "`player_name` LIKE '%". $text[$i] ."%'";
}
}
data_dump($text, array($textTitleSql, $textPostSql, $textAuthorSql), "search");
//data_dump($text, array($textTitleSql, $textPostSql, $textAuthorSql), "search");
}
?>
<h1>Search forum</h1>
@ -204,4 +205,5 @@ if ($type !== false && $text !== false && $type <= 4 || $type > 4 && $type <= 6)
} else echo "No results.";
} else echo "<br><b>You must fill in all fields!</b>";
include 'layout/overall/footer.php'; ?>
include 'layout/overall/footer.php';
?>