Witam serdecznie, sciagnalem skrypt wyszukiwarki z tutoriala ZEND`owego
iii dziala a zarazem nie dziala:
na stronie:
http://infoparty.pl/this.php - dziala
http://infoparty.pl/tracklist.php - nie dziala
wpiszcie np armin
mimo ze w obu miejscach kod jest praktycznie taki sam ( roznia sie tylko glowne ify z $c na $_POST ):
<?
if(!$c) {
?>
<form action="this.php?c=1" method=POST>
<b>Find Results with: </b><br>
Any of these words: <input type="text" length=40 name="any"> <br>
All of these words: <input type="text" length=40 name="all"> <br>
None of these words: <input type="text" length=40 name="none"> <br>
<input type="submit" value="Search">
</form>
<?
} else if($c) {
include("include/config.php");
if((!$all) || ($all == "")) { $all = ""; } else { $all = "+(".$all.")"; }
if((!$any) || ($any == "")) { $any = ""; }
if((!$none) || ($none == "")) { $none = ""; } else { $none = "-(".$none.")"; }
$query = "
SELECT *,
MATCH(`nazwa`) AGAINST ('$all $none $any' IN BOOLEAN MODE) AS `score`
FROM `tracklisty`
WHERE MATCH(`nazwa`) AGAINST ('$all $none $any' IN BOOLEAN MODE) ORDER BY `score` DESC";
if(!$artm1) {
}
echo "<b>Article Matches</b><br>"; echo "<tr><td>Score </td><td>Title </td><td>Body</td></tr>"; $val = round($artm2['score'], 2
); $val = $val*10;
echo "<tr><td>$val</td>"; echo "<td>{$artm2['nazwa']}</td>"; }
}
else {
echo "No Results were found in this category.<br>"; }
}
?>
help? :-)
Ten post edytował bumfank 19.05.2007, 10:39:17