⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add.asp

📁 用户名、密码和权限存放在本案例数据库中的admin表
💻 ASP
字号:
<%
if session("longin")<>1 then  '判断是否登录
   response.Redirect("login.asp")  '转移到登录页面
end if
%>
<!--#include file="conn.asp"-->

<script language="javascript">
<!--
// 
function submitcheck()
{
if(form1.filename.value == "")
         { window.alert ("请填写设计标题!");
	   form1.filename.focus();
	   return false;
         }
 if(form1.content.value == "")
         { window.alert ("请填写设计简介!");
	   form1.content.focus();
	   return false;
         } 
}
-->
</script>


<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<title>后台管理——添加</title>
</head>
<%if request("submit")<>""  then%>
<%
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM design"
rs.Open sql,conn,1,3
rs.Addnew
rs("filename")=Server.Htmlencode(Request("filename"))
rs("typeid")=Server.Htmlencode(Request("typeid"))
rs("url")=Server.Htmlencode(Request("url"))
rs("pic")=Server.Htmlencode(Request("pic"))
rs("piclink")=Server.Htmlencode(Request("piclink"))
rs("content")=Server.Htmlencode(Request("content"))
rs("time")=date()
rs.Update
rs.Close
Set rs=Nothing
Response.Write("<p><P align=center><br><br><br ><font color=red size=2>"&Request("filename")&"——添加成功!</font><P><p>")
%>
<%else%>

<form action="add.asp" method="post" name="form1" onsubmit="return submitcheck()" >
<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
    <tr bgcolor="#f1f1f1"> 
      <td colspan="2"><strong>增加新产品/作品</strong></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="118">设计标题:</td>
      <td width="363"> <input name="filename" type="text" id="filename" size="19"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>相关网址:</td>
      <td> <input name="url" type="text" id="url" size="19"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>小图地址:</td>
      <td> <input name="pic" type="text" id="pic" size="19"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>大图或者图片连接地址:</td>
      <td> <input name="piclink" type="text" id="piclink" size="19"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>设计简介:</td>
      <td bgcolor="#FFFFFF"> 
        <textarea name="content" cols="50" rows="4" id="content"></textarea>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>设计类型:</td>
      <td>
      <%
      Set rs1 = conn.Execute("select * from designtype order by typeid") '选出设计类型到记录集中
      %>
      <%   
      do while not rs1.eof                                                '循环语句
%>
      
     <input name="typeid" type="radio" value="<%=rs1("typeid")%>"><%=rs1("typename")%>
      <%
      rs1.movenext   '记录集指针转移到下一位
      loop           '循环
      set rs1=nothing
      conn.close
      set conn=nothing
      %>
     </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td>&nbsp;</td>
      <td> <input name="submit" type="submit" value="提交"></td>
    </tr>
</table>
  </form>
<%end if%>

</BODY>
</HTML>

⌨️ 快捷键说明

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