<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.redirect "index.asp"
end if
lid=request("id")
sql="select * from Free_Jzw where id=cint('"&lid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,1
if not rs.eof then

if request.form("question")<>"" then
sql="select * from Free_Jzw where id=cint('"&lid&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,3,2

rs("question")=HtmlEncode(request.form("question"))
rs("key")=HtmlEncode(request.form("key"))

rs.update
response.redirect "ook.asp"
end if
end if
%>
<html>

<head>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1; margin-bottom: 1 }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>编辑智力题目</title>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function checkadd()
{   
    if (document.postart.question.value.length<1)
	{
        alert("请填写智力题目！");
        document.postart.question.focus();
        return false;
    }
    if (document.postart.key.value.length<1)
	{
        alert("请填写答案！");
        document.postart.key.focus();
        return false;
    }
}
//-->
</SCRIPT>
</head>
<body background="images/bg.gif">
<div align="center">
  <center>
  <table border="0" width="100%" cellspacing="0" cellpadding="0">
    <form action="" method="post" name="postart" onSubmit="return checkadd()">
    <tr>
      <td width="100%" colspan="2"></td>
    </tr>
    <tr>
      <td width="35%" align="right" height="26">题目：</td>
      <td width="65%" height="26"><input type="text" name="question" size="40" maxlength="100" style="border: 1 solid #000000" value="<%=rs("question")%>"> 
        <font color="#FF0000">100字以内</font></td>  
    </tr>  
    <tr>  
      <td width="35%" align="right" height="26">答案：</td>  
      <td width="65%" height="26"><input type="text" name="key" size="30" maxlength="50" style="border: 1 solid #000000" value="<%=rs("key")%>">   
        <font color="#FF0000">50字以内</font></td>  
    </tr>  
    <tr>  
      <td width="100%" align="right" colspan="2">  
        <p align="center"><input type="submit" value="修改" name="submit">&nbsp;      
        <input type="reset" value="取消" name="reset">&nbsp; <input type="button" value="返回" name="back" onClick="window.location.href='index.asp';"></td>    
    </tr>    
    </form>    
  </table>    
  </center>    
</div>                   
</body>                      
                      
</html>                      
