vote_edit.asp

来自「这是一个学生毕业时做的教务系统」· ASP 代码 · 共 93 行

ASP
93
字号
<!--#include file=conn.asp-->
<%
IF not(Session("KEY")="super" or Session("KEY")="input") THEN
response.redirect "login.asp"
response.end
END IF
%>
<%id=trim(request("id"))
if request("actions")="1" then
     if request("choice")="1" then
	    choi=false
     else
	    choi=true
     end if
	 if request("current")="1" then
	    cu=true
     else
	    cu=false
     end if
     topic=trim(request("topic"))
     if topic="" or len(topic)>200 then
	    response.write "<script language='javascript'>alert('主题内容不能为空或大于指定字数!');history.go(-1);</script>"
     else
	    set rs=server.CreateObject("adodb.recordset")
		sql="select * from vote_bigclass where id="&id
		rs.open sql,conn,1,3
		rs("title")=topic
		rs("current")=cu
		rs("choice")=choi
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language='javascript'>alert('主题修改成功!');history.go(-2);</script>"

     end if
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from vote_bigclass where id="&request("id")
rs.open sql,conn
%>
<link href="news.css" rel="stylesheet" type="text/css">

<br>
<br>
<br>
<br>
<table width="70%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <tr>
    <td height="25" valign="middle" bgcolor="abb8d6"> 
      <div align="center"><strong>投 票 主 题 修 改</strong></div></td>
  </tr>
</table>

<form name="form1" method="post" action="">
  <table width="70%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
    <tr bgcolor="#FFFFFF"> 
      <td width="24%" height="45"> 
        <div align="center">主题内容</div></td>
      <td width="76%" valign="bottom"> 
        <textarea name="topic" cols="40" rows="4" id="topic"><%=rs("title")%>
</textarea>
      小于 200字</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td valign="top"> 
        <div align="center">多选/单选</div></td>
      <td valign="bottom"> 
        <%if rs("choice")=true then%>
	  <input name="choice" type="radio" value="1" >
        单选
          <input type="radio" name="choice" value="2" checked>
      多选
	  <%else%>
	  <input name="choice" type="radio" value="1" checked>
        单选
          <input type="radio" name="choice" value="2" >
      多选
	  <%end if%></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" valign="bottom"> 
        <div align="center">
        <input type="submit" name="Submit" value="提交">
        &nbsp;&nbsp;<input type="reset" name="Submit2" value="重置">
        <input name="actions" type="hidden" id="actions" value="1">
      </div></td>
    </tr>
  </table>
 
</form> <p>&nbsp;</p>
<p>&nbsp;</p>

<%end if%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?