Курсовая работа: Создание инструментального средства для организации социологических опросов
}
if(isset($_REQUEST['del']) &&isset($_REQUEST['ankID']))
{
$id = $_REQUEST['del'];
$query = "DELETE FROM `quest` WHERE id = $id LIMIT 1";
$result = @mysql_query($query);
}
if(isset($_REQUEST['saveank']))
{
@$name = $_REQUEST['name'];
@$ankID = $_REQUEST['ankID'];
@$quest=$_REQUEST['quest'];
if($name!='')
$query = "UPDATE `ank` SET `title` = '$name' WHERE `idank` =$ankID";
mysql_query($query);
if(!is_array($quest))
return;
foreach($quest as $k => $v)
{
$sql ="UPDATE `quest` SET `text` ='". $v['text'] ."',`type`='". $v['type']."' WHERE `id` =$k";
mysql_query($sql);
}
echo "<script>document.location.href='index.php?ank_edit=edit&ankID=$ankID'</script>\n";
}
if(isset($_REQUEST['newquest'])&& isset($_REQUEST['ankID'])&& $_REQUEST['newquest']['text']!="")
if($_REQUEST['newquest']!='')
{
$id = htmlspecialchars($_REQUEST['ankID']);
$text = htmlspecialchars($_REQUEST['newquest']['text']);