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

📄 leaveword.asp

📁 asp交友程序1.0版 ,本程序使用的核心为蓝芒asp交友程序
💻 ASP
字号:
<%
Option Explicit
dim conn,DBPath
dim rs_lar,rs_word
dim netname,word,user_id,errst,sql
'叛断Session变量是否超时
if isempty(session("user_id")) then
   response.redirect "timeout.htm"
end if

if session("user_id")=1 then
	response.redirect "notreg.htm"
	response.end
end if
'-----------------------------------------------------------------
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("friend.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'-----------------------------------------------------------------
Set rs_lar = Server.CreateObject("ADODB.Recordset")
sql="select * from larchives where user_id =" & session("user_id")
rs_lar.open sql,conn,3,2
netname        =rs_lar("netname")
word           =request("word")
user_id        =request("user_id")

if word<>"" then
if len(word)>200 or word="" then
%>
<table border="1" width="31%" bordercolor="#000000" cellspacing="0" align="center">
<td bgcolor="#000000">
  <p align="center"><b><font color="#FFFFFF" size="2">错误提示</font></b>
<tr>
<td>
<table width="100%" cellspacing="0">
  <tr>
    <td width="100%" bgcolor="#EEEEEE">
      <p align="center"><font size="2">留言最多不能超过200个符或不能为空!</font>
    </td>
  </tr>
  <tr>
    <td width="100%" bgcolor="#EEEEEE">
      <p align="center"><a href="" onclick="history.go(-1)"><font size="2">[返回]</font></a>
    </td>
  </tr>
</table>
</td>
</tr>
</table>

<%
response.end
end if
   Set conn = Server.CreateObject("ADODB.Connection")
   DBPath = Server.MapPath("friend.mdb")
   conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
   Set rs_word = Server.CreateObject("ADODB.Recordset")
   rs_word.open "leaveword",conn,3,2
   rs_word.addnew
   rs_word("netname")=netname
   rs_word("word")=word
   rs_word("date")=date
   rs_word("for_id")=user_id
   rs_word("user_id")=session("user_id")
   rs_word.update
   rs_word.close
   set rs_word=nothing
   response.write "<script language='javascript'>" & vbcrlf
   response.write "history.go(-2);"
   response.write "</script>"
end if
%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<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>
<style>
<!--
tr           { font-size: 10pt }
body         { font-size: 10pt }
a:link       { color: blue; text-decoration: none }
a:visited    { color: blue; text-decoration: none }
a:active     { color: #ff9966; text-decoration: none }
a:hover      { color: red; text-decoration: none }
-->
</style>

</head>

<body>
<form>
<input type="hidden" name="user_id" value="<%=user_id%>">
<div align="center">
  <table border="1" bordercolor="#000000" cellspacing="0" height="111">
    <tr>
      <td bgcolor="#000000" height="13">
        <p align="center"><b><font color="#FFFFFF">写留言</font></b></td>
    </tr>
    <tr>
      <td bgcolor="#EEEEEE" height="90">
        <table border="0" cellspacing="0" height="45">
          <tr>
            <td height="25">您的网名:</td>
            <td height="25"><input type="text" name="netname" size="20" value="<%=netname%>" disabled></td>
          </tr>
          <tr>
            <td height="1" valign="top">留言:</td>
            <td rowspan="2" height="21" valign="top">
            <textarea rows="4" name="word" cols="44" wrap="hard"></textarea></td>
          </tr>
          <tr>
            <td height="28"></td>
          </tr>
        <tr>
            <td height="30" colspan="2" valign="middle">
              <p align="right"><input type="submit" value="提交" name="B1"><input type="reset" value="重写" name="B2"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>
</div>
</form>

</body>

</html>

⌨️ 快捷键说明

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