<?
if(isset($_POST['name']) && isset($_GET['ok']))
{
$name=my_esc($_POST['name']);
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_collective` WHERE `name` = '$name'"),0)!=0)
{
$ct=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_collective` WHERE `name` = '$name'"));
header("Location:?collective=$ct[id]");
}
else echo err_game("Компания не найдена");
}
echo "<div class='event'><h1>Поиск Компаний</h1></div>";
echo "<div class='content'>";
echo "<div class='block'>";
echo "<div class='small ptm'>";
echo "<div style='padding-top:4px'>";
echo "<div class='event' style='height:2px'>";
echo "<div class='eventlight' style='height:2px;width:".rand(75,95)."%'>";
echo "</div>";
echo "</div>";
echo "<ul class='block'>";
echo "<li>";
echo "Введите название Компании:</span><br/><form method='post' action='?search_collective&ok'>";
echo "<input type='text' name='name' value=''><br/>";
echo "<input type='submit' name='ok' value='Пoиcк'>";
echo "</form></div>";
include_once 'inc/foot.php';
include_once 'inc/foot.php';
?>