<title>Untitled Document</title>
Echo ";
Include "check_admin.php";
echo "Add a question bank
\ n ";
if (!$_post["type"])
{
?>
}
else if (!$_post["content"])
{
?>
}
Else
{
Include "config.php";
$type =$_post["type"];
$content =$_post["Content"];
$answer =$_post["Answer"];
if ($type!=1)
{
$sql = "INSERT into $db _examsystem_question (content,type,answer) VALUES (' $conten ', ' $type ', ' $answer ')";
$result =mysql_query ($sql, $my _con) or Die (Mysql_error ());
if ($result)
{
echo "Successfully added the question bank";
echo "Click here to return";
}
else echo "Error in adding a question bank";
}
Else
{
$check =$_post["Check"];
$sql = "INSERT into $db _examsystem_question (content,type) VALUES (' $content ', ' $type ')";
$result =mysql_query ($sql, $my _con) or Die (Mysql_error ());
$question _id=mysql_insert_id ();
$sql 2= "INSERT into $db _examsystem_answer (content,question,answer) VALUES";
for ($i =0; $i <4; $i + +)
{
$sql 2= $sql 2. " (";
$sql 2= $sql 2. "'". $answer [$i]. "',";
$sql 2= $sql 2. $question _id. "'";
if ($check = $i) $sql 2= $sql 2. " 1) ";
else $sql 2= $sql 2. " 0) ";
if ($i <3) $sql 2= $sql 2. "'";
}
$result 2=mysql_query ($sql 2, $my _con) or Die (Mysql_error ());
if ($result and $result 2)
{
echo "Successfully added the question bank";
echo "Stand-alone here return";
}
else echo "Error in adding a question bank";
}
}
Echo ";
?>
This is the teacher set up an online answer system I wrote this is one of the additions to the question bank part but my last confirmation button clicked will not jump to the database statement he always goes back to the previous step, that is, I can not save the written topic content into the database I've been bothering you for a week. Please help me brother elder sister humbly
Reply to discussion (solution)
123123