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

📄 write.asp

📁 本系统由齐齐哈尔职业学院计算机软件052班 袁利峰 开发, 版权属于 袁利峰 所有,本作品仅作为网友学习使用, 如果您需要本系统或者需要在本系统基础上进行二次开发,请与我联系 QQ:20893918
💻 ASP
字号:
<%@ CODEPAGE = "936" %>
<!--#include file="Connections.asp" -->
<!--#include file="ubb.js" -->
<!--#include file="top.asp" -->
<%
if request.querystring("action")="add" then
laccess=Request.Form("laccess")
username=Request.Form("username")
email=Request.Form("email")
qq=Request.Form("qq")
address=Request.Form("Address")
home=Request.Form("home")
face=Request.Form("face")
title=Request.Form("title")
head=Request.Form("head")
ip=Request.Form("ip")
content=Request.Form("f3_content")
action="ture"
if username="" then 
error1="用户不能为空<BR>" 
action="false"
 end if
 if title="" then 
error1=error1&"标题不能为空<BR>" 
action="false"
 end if

if content="" then 
error1=error1&"内容不能为空<BR>" 
action="false"
 end if
if len("content")>total then 
error1=error1&"内容超过了"&total&"的限制" 
action="false"
end if
if action="false" then

 response.redirect("?action=error&error1="&error1&"")
  else
strSql = "insert into guestbook (laccess,username,head,ip,email, home,face,occation,qq,title,content) Values ('"
 strSql = StrSQl & laccess & "','"
 strSql = StrSQl & username & "','"
 strSql = StrSQl & head & "','"
 strSql = StrSQl & ip & "','"
 strSql = StrSQl & email & "','"
 strSql = StrSQl & home & "', '"
 strSql = StrSQl & face & "', '"
 strSql = StrSQl & address & "', '"
  strSql = StrSQl & qq & "', '"
 strSql = StrSQl & title & "', '"

 strSql = StrSQl & content & "')"
 conn.Execute (strsql)
 response.redirect"index.asp"
 response.end

 end if
 elseif request.querystring("action")="" then
%>
<div align="center"><center>
  <table width="760" border="1" align="center" cellpadding="4" cellspacing="1" bordercolor="<%=bgcolor%>" style="border-collapse: collapse">
<form name="form1" method="POST" action="write.asp?action=add"   onkeydown="up()" >
    <tr align="center"> 
      <td height="23" colspan="2" class=tdc1 style="font-weight: bold"  <%=hColor%>>签写留言</td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc>你的名字:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input name="username" type="text" class=tdc size="20" maxlength="15"> 
        *(必填)
      </td>
    </tr>
    <tr>
      <td align="right" bgcolor=<%=tColor2%> class=tdc>留言主题:</td>
      <td bgcolor=<%=tColor2%> class=tdc>
        <input name="title" type="text" class=tdc size="40" maxlength="40">
    *(必填) </td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc>电子邮件:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input name="email" type="text" class=tdc size="25" maxlength="25">
      </td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc>来自何方:</td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <input name="Address" type="text" class=tdc size="25" maxlength="15">
      </td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc>留言内容:</td>
      <td bgcolor=<%=tColor2%> class=tdc>  
        <textarea name="f3_content" cols="60" rows="8" class=tdc></textarea>
        *(必填)      </td>
    </tr>
    <tr> 
      <td width="20%" align="right" bgcolor=<%=tColor2%> class=tdc> 
        <input type="hidden" name=ip  value="<% = o_ip %>">
      </td>
      <td bgcolor=<%=tColor2%> class=tdc> 
        <p>
          <input type="submit" name="Submit" value="提交" class=bdtj>
          <input type="reset" name="Submit2" value="重设" class=bdtj>
          [按CTRL+ENTER 直接发表]
          <input type="checkbox" name="laccess" value="1">
		  只有管理员可以看
</td>
    </tr>

</form>
  </table>
 

    </center>
</div>
<% else%>
<center>
  <table width="760" border="1" align="center" cellpadding="4" cellspacing="1" bordercolor="<%=bgcolor%>" style="border-collapse: collapse">

        <tr> 
      <td width="20%" align="center" <%=tColor%> class=tdc>错误提示</td>
    </tr>
    <tr> 
      <td width="20%" align="center" bgcolor=<%=tColor2%> class=tdc> 
    <%=request.querystring("error1")%>
   <BR> <a href="javascript:history.go(-1)">返回</a>
      </td>
    </tr>
  </table>
 

</center>
</div>

 <%end if%>
</body></html>

⌨️ 快捷键说明

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