Почему Search не работает?
Спасибо
######################################
Ето скрипт.
######################################
<form name="itemsform">
<?
if ($option == "search"):
exec("grep -i $search dbase.txt",$execAr);
if ($execAr[0] != ""):
while ( list($key,$val) = each( $execAr ) ) {
$tok = strtok($val,"|");
$categ = $tok;
$tok = strtok("|");
$name = $tok;
$tok = strtok("|");
$type = $tok;
$tok = strtok("|");
$id = $tok;
$tok = strtok("|");
$options = $tok;
$tok = strtok("|");
$price = $tok;
$tok = strtok("|");
$normpr = $tok;
$tok = strtok("|");
$img = $tok;
$tok = strtok("|");
$stockop = $tok;
$tok = strtok("|");
$advdate = $tok;
$tok = strtok("|");
$details = $tok;
$tok = strtok("|");
$desc = $tok;
displayProd($categ,$type,$id,$name,$options,$price,$normpr,$img,$stockop,$advdate,$details,$desc);
}
else:
echo "There were no matches for your search query.
<P>
<hr width=\\"100%\\" size=\\"1\\" noshade color=\\"black\\">";
endif;
else:
$cartFile = File("dbase.txt");
$length = sizeof($cartFile);
$i = 1;
while ($i < $length):
$tok = strtok($cartFile[$i],"|");
$categ = $tok;
$tok = strtok("|");
$name = $tok;
$tok = strtok("|");
$type = $tok;
$tok = strtok("|");
$id = $tok;
$tok = strtok("|");
$options = $tok;
$tok = strtok("|");
$price = $tok;
$tok = strtok("|");
$normpr = $tok;
$tok = strtok("|");
$img = $tok;
$tok = strtok("|");
$stockop = $tok;
$tok = strtok("|");
$advdate = $tok;
$tok = strtok("|");
$details = $tok;
$tok = strtok("|");
$desc = $tok;
if ($categ == "$cat" || $cat == ""):
displayProd($categ,$type,$id,$name,$options,$price,$normpr,$img,$stockop,$advdate,$details,$desc);
endif;
$i++;
endwhile;
endif;
?>
</form>
######################################
А это файл dbase.txt
######################################
Biblies|Classical Armenian (grabar)|single|dedehhccdffih| |30|30|1.jpg|instock| |#|Classical Armenian (grabar), reprint of Constantinople, 1895 edition, includes also the Deuterocanonical books taken from Zohrapian Bible, 1805. The footnotes introduce the variations from Hebrew and Greek texts. The Bible Society of Armenia, 1997
Biblies|New translation|single|dedehjffdefee| |25|25|2.jpg|instock| |#|New translation of the Bible published by Fr. Arsen Bagratouni (1860) into Eastern Armenian, classical spelling. The Mother See of Holy Etchmiadzin and the Bible Society of Armenia, 1994, 1999, 2001