Gazelle/sections/questions/take_edit_answer.php

14 lines
369 B
PHP
Raw Normal View History

2013-10-21 08:01:00 +00:00
<?
authorize();
$ID = $_POST['id'];
$UserID = $_POST['userid'];
$Answer = db_string($_POST['edit']);
if (empty($Answer) || !is_number($ID) || $UserID != $LoggedUser['ID']) {
error(403);
}
$DB->query("UPDATE staff_answers SET Answer = '$Answer' WHERE QuestionID = '$ID' AND UserID = '$UserID'");
header("Location: questions.php?action=view_answers&userid=$UserID");