bsp;for ($sm=1;$sm<=$select;$sm++) {
echo "$sm<input type=\"text\" name=\"".$xuanxiang[$sm]."\" size=\"10\"> ";
}?>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#f5f5f5">
<div align="center">
<input type="submit" onSubmit="return check_com()" name="Submit_new" value="确定">
</div>
</td>
</tr>
</table>
</form>
<?
}
if ($Submit_new)
{//1
//从CURRENT表中读出数据放到历史结果表中
$query="select * from $current";
$result=mysql_query($query);
$row_num=mysql_num_rows($result);
$rows=mysql_fetch_array($result);
if ($rows!=0){//2
for ($i=1;$i<$row_num;$i++)
{//3
$seek=mysql_data_seek($result,$i);
$row=mysql_fetch_row($result);
$jieguo=$jieguo.$row[0]."&".$row."\n";
}//4
$date=date("Y-m-d");
$query_inse="insert into $alldata (theme,idea,begin,end) values(''$rows[0]'',''$jieguo'',''$rows'',''$date'')";
$insert=mysql_query($query_inse);
//5
//删除current中原有数据
if ($insert) mysql_query("delete from $current");
}
//加入新数据
$begin=date("Y-m-d");
$query_new_theme="insert into $current (xx,date) values(''$theme'',''$begin'')";
$new_theme=mysql_query($query_new_theme);
if ($new_theme) echo "主题更改成功!<br>";
for ($n=1;$n<=$select2;$n++) {//8
$query_new_xx="insert into $current (xx) values(\"${$xuanxiang[$n]}\")";
$new_xx=mysql_query($query_new_xx);
if ($new_xx)
echo "选项<font color=red>${$xuanxiang[$n]}</font>添加成功!<br>";else echo "选项<font color=red>${$xuanxiang[$n]}</font>添加失败!<br>";
} //9
echo "<center>3秒后返回</center><meta http-equiv=\"refresh\" content=\"3;url=$PHP_SELF\">";
} //10
//显示历史结果
if (isset($vhistory) && $vhistory=="yes") {
$query="select * from $alldata order by id desc";
$result=mysql_query($query);
while($rows=mysql_fetch_array($result)) {
$idea=explode("\n",$rows[idea]);
$all=0;
for ($j=0;$j<count($idea)-1;$j++) {
$allidea=explode("&",$idea[$j]);
$all=$all+$allidea;
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#EAEAEA">
<td height="20"><? echo "【主题】 ".$rows[theme].&