Home  >  Article  >  Backend Development  >  求给位大哥大姐帮帮忙 小弟要急哭了

求给位大哥大姐帮帮忙 小弟要急哭了

WBOY
WBOYOriginal
2016-06-23 13:12:221373browse

nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档



echo"
";
include"check_admin.php";
echo"添加题库

\n";
if(!$_POST["type"])
{
?>














请添加题目类型
题目类型




}
else if(!$_POST["content"])
{
 ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
题目类型:  if($_POST["type"]==1)echo "选择题";
 else echo "判断题";
 ?>
 
请输入题目内容
请输入/选择该题答案
  if($_POST["type"]==1)
 {
 for($i=0;$i  {
 echo ($i+1).".\n";
 echo"
\n";
 }
 }
 else
 {
 echo"正确\n";
 echo"错误\n

";
 }
 echo"被选中项为正确答案";
 ?>
 


}
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"成功添加题库";
echo"单击这里返回";
}
else echo"添加题库出错";
}
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();
$sql2="INSERT INTO $db_examsystem_answer(content,question,answer) VALUES";
for($i=0;$i {
$sql2=$sql2."(";
$sql2=$sql2."'".$answer[$i]."',";
$sql2=$sql2.$question_id."'";
if($check=$i) $sql2=$sql2."1)";
else $sql2=$sql2."0)";
if($i }
$result2=mysql_query($sql2,$my_con) or die(mysql_error());
if($result and $result2)
{
echo"成功添加题库";
echo"单机这里返回";
}
else echo"添加题库出错";
}
}
echo"
";
 ?>

这是老师布置的一个在线答题系统 我写的这个是其中的添加题库部分 可是 我最后的那个确认按钮 点击以后 并不会跳转到数据库语句 他总是返回上一步 也就是我没法将写好的题目内容保存进入数据库 我为此困扰了一周了 恳请各位大哥大姐帮帮我 小弟拜谢


回复讨论(解决方案)

123123

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn