View file kat_by_ineext/search.php

File size: 988B
<?
/*
Powered by eCats
By: iNeeXT
*/
require_once 'display/head.php';

if (isset($_GET['query']) and !empty($_GET['query']))
{
//mysql_real_escape_string
  	$query = mysql_query("SELECT * FROM `".$prefix."sites` WHERE `text` LIKE '%".mysql_real_escape_string(htmlspecialchars(@urldecode($_GET['query'])))."%' order by `id`");
  	$total = mysql_result(mysql_query('SELECT FOUND_ROWS()'), 0);
	if($total == 0)
	{
  	echo '<div class="raz">Совпадений не найдено!</div>';
	}
	else
	{
		while($row = mysql_fetch_assoc($query))
		{
		echo '<b class="raz">Совпадений: '.$total.'</b>';
		echo '<div class="co"><a href="info.php?id='.$row['id'].'">'.$row['name'].'</a></div>';
    require_once 'display/foot.php';
   	exit;
		}
	}
}

echo '<form action="search.php" method="get">
 	 Описание:<br/>
 	<input name="query" type="text" /><br/>
 	<input type="submit" value="Найти"></form>';
require_once 'display/foot.php';
?>