Курсовая работа: Разработка сайта. Система поиска по сайту
<? php
function error ($error,$file) {exit ('<font face=verdana size=1 color=#de0000><b>'. $error. '<br> ['.htmlspecialchars ($file). '] </b></font>'); }
@set_time_limit (0);
@SetLocale (LC_ALL,"ru_RU. CP1251");
function CheckConf ($conf)
{
while (list ($section,$array) =each ($conf))
while (list ($key,$value) =each ($array))
if (! strlen ($value))
error ("В файле параметров скрипта, а именно в секции <font color=green>". $section. "</font>, пуст ключ <font color=green>". $key. "</font>",$conf ['dir'] ['path']. "/inc/config. inc. dat");
}
$term_paper=parse_ini_file (". /inc/config. inc. dat",1) or error ("не могу загрузить основной файл параметров",". /inc/config. inc. dat");
include ($term_paper ['file'] ['functions']);
CheckConf ($term_paper);
while (list ($section,$array) =each ($term_paper))
while (list ($key,$value) =each ($array))
$term_paper ['other'] [chr (73). chr (110). chr (105). ucfirst (strtolower ($section)). ucfirst (strtolower ($key))] =$value;
settype ($FirstTime=term_paper_time (),"integer");
if (isset ($_GET ['query']))
{
$query=$UserQuery=term_paper_stripslashes ($_GET ['query']);
preg_match_all ("/\w+/",$query,$QueryArray);
$TempQuery=array_unique ($QueryArray [0]);
$QueryArray [0] =$term_paper ['result'] =null;
while (list (,$value) =each ($TempQuery))
$QueryArray [0] [] =$value;
$result=array ();
$found=0;
if (! $QueryCount=count ($QueryArray [0]))