Файл: pages/search.php
Строк: 23
<?PHP
require '../Core/start.php';
$title = 'Поиск сайта';
require '../Core/header.php';
if(isset($_POST['search_go']))
{
$search = text($_POST['search']);
$count_search = mysql_result(mysql_query("SELECT COUNT(*) FROM `site` WHERE `url` = '$search'"),0);
if($count_search == '0')
{
?>
<div class="menu">
Указаный сайт не найден<br />
</div>
<div class="back"><a href="/pages/search.html">Другой поиск</a></div>
<?
}
else
{
$query_search = mysql_query("SELECT * FROM `site` WHERE `url` = '$search'");
$objects = $system['page'];
nav_start($count_search, $objects);
while($site = mysql_fetch_array($query_search))
{
$category = mysql_fetch_array(mysql_query("SELECT `id`,`name`,`translitit` FROM `category` WHERE `id` = '".$site['id_category']."'"));
?>
<div class="link2">
<b>Название:</b> <a href="/pages/site/<?=$site['translitit']?>.html"><?=on_text($site['name'])?></a><br />
<b>Url:</b> <a href="http://<?=$site['url']?>"><?=on_text($site['url'])?></a><br />
<b>Категория:</b> <a href="/pages/category/<?=$category['translitit']?>.html"><?=on_text($category['name'])?></a>
</div>
<?
}
?><div class="back"><a href="/pages/search.html">Другой поиск</a></div><?
# Выводим постраничную навигацию
view_nav('/pages/search.php?');
}
}
else
{
?>
<div class="menu">
<form action="/pages/search.html" method="POST">
Поиск сайта <small>(URL без http://):</small><br />
<input type="text" name="search"> <input type="submit" name="search_go" value="Поиск">
</form>
</div>
<?
}
require '../Core/footer.php';
?>