Файл: ferma/inc/search_ct.php
Строк: 25
<?
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 "Введите название колхоза:</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';
?>