Вход Регистрация
Файл: mylaf.ru/mods/forum/deithem/vote.php
Строк: 92
<?php
include_once '../../sys/inc/start.php';
include_once 
'../../sys/inc/compress.php';
include_once 
'../../sys/inc/sess.php';
include_once 
'../../sys/inc/home.php';
include_once 
'../../sys/inc/settings.php';
include_once 
'../../sys/inc/db_connect.php';
include_once 
'../../sys/inc/ipua.php';
include_once 
'../../sys/inc/fnc.php';
include_once 
'../../sys/inc/user.php';
$them=intval($_GET['id']);
$them mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_them` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if (
$them['id']==0)header("location:/index.php?");
if (
$them['opros']==1)header("location:/index.php?");
if (isset(
$_POST['ok'])){
$text=esc(stripcslashes(htmlspecialchars($_POST['text'])));
$vot1=my_esc($_POST['vot1']);
if (
strlen2($vot1)<1)$err="Первый вариант обязателен к заполнению.";
$vot2=my_esc($_POST['vot2']);
if (
strlen2($vot2)<1)$err="Второй вариант обязателен к заполнению";
if (
strlen2($vot4)>32)$err="Четвертый вариант пишите меньше.";
if (
strlen2($vot5)>32)$err="Пятый вариант пишите меньше.";
if (
strlen2($vot3)>32)$err="Третий вариант пишите меньше.";
$vot3=my_esc($_POST['vot3']);
$vot4=my_esc($_POST['vot4']);
$vot5=my_esc($_POST['vot5']);
if (
strlen2($vot2)>32)$err="В втором варианте пишите меньше.";
if (
strlen2($vot1)>32)$err="В первом варианте пишите меньше.";
if (
strlen2($text)<1)$err="Заполните текст опроса.";
if (
strlen2($text)>1000)$err="Текст опроса нужно писать меньше.";
if(!isset(
$err)){
mysql_query("UPDATE `forum_them` SET `text`='$text' WHERE `id`='$them[id]'");
$them['opros']=1;
mysql_query("UPDATE `stat_s` SET `opros` = '1' WHERE `id` = '$stat[id]' LIMIT 1");
mysql_query("INSERT INTO `forum_votes` (`id_them`, `var`, `num`) VALUES ('$them[id]', '$vot1', '1')");
mysql_query("INSERT INTO `forum_votes` (`id_them`, `var`, `num`) VALUES ('$them[id]', '$vot2', '2')");
mysql_query("INSERT INTO `forum_votes` (`id_them`, `var`, `num`) VALUES ('$them[id]', '$vot3', '3')");
mysql_query("INSERT INTO `forum_votes` (`id_them`, `var`, `num`) VALUES ('$them[id]', '$vot4', '4')");
mysql_query("INSERT INTO `forum_votes` (`id_them`, `var`, `num`) VALUES ('$them[id]', '$vot5', '5')");
header("location:/forum/them.php?id=$them[id]");
}
}
$set['title']="Создание опроса";
include_once 
'../../sys/inc/thead.php';
title();
aut();
err();
echo 
"<form method='post' action='vote.php?id=$them[id]&$passgen'>";
echo 
"Опрос:<br/>";
echo 
"<textarea name='text'></textarea><br />n";
echo 
"Варианты ответов:<br/>";
echo 
"1.<input type='text' name='vot1' value='' /><font color='red'>*</font><br />n";
echo 
"2.<input type='text' name='vot2' value='' /><font color='red'>*</font><br />n";
echo 
"3.<input type='text' name='vot3' value='' /><br />n";
echo 
"4.<input type='text' name='vot4' value='' /><br />n";
echo 
"5.<input type='text' name='vot5' value='' /><br />n";
echo 
"<input value='Создать' type='submit' name='ok'/><br />n";
echo 
"</form>";
include_once 
'../../sys/inc/tfoot.php';
}
echo 
"<input value='Создать' type='submit' name='ok'/><br />n";
echo 
"</form>";
echo 
"<a href='/forum/deithem.php?id=$them[id]'><div class='foot'><img src='/style/icons/str2.gif' alt='!'>Вернутся к действиям</div></a>";
include_once 
'../../sys/inc/tfoot.php';
?>
Онлайн: 1
Реклама