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

📄 wish.asp

📁 一路飞扬在线同学录单班级版,主要用于个人系统中的同学录,不过对于学习有帮助!
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="config.asp"-->
<!--#include file="inc/char.asp"-->
<!--#include file="live.txt"-->

<%

'声明变量
Dim PROName,PROEType,PROCNAME,VerNum,VerUpdate,PROVer,PROType,PROMaster,PROPublish,PROCopyRight,CopyRightInfo,JavaCopyRightInfo


PROName="LinYun Wish Board Bottle"
PROEType="Single-User Personnal"
PROCNAME="一路飞扬在线祈愿版"
VerNum="Ver1.0"
VerUpdate="030726"
PROVer=VerNum&" U "&VerUpdate
PROType="个人用户正式版 (简体中文)"
PROMaster="一路飞扬在线"
PROPublish=" wangyy168@tom.com"
PROCopyRight="CopyRight (c) 2003-2005 http://gd.ywzc.net All Rights Reserved"
PROCopyRightInfo="欢迎您来访一路飞扬在线──许愿祝福!"

CopyRightInfo = PROName&chr(13)&_
               "中文名字:"&PROCNAME&chr(13)&_
               "版本号:"&PROVer&chr(13)&_
               "版本类型:"&PROType&chr(13)&_
               "技术支持:"&PROMaster&chr(13)&_
               "网管信箱:"&PROPublish&chr(13)&_
               PROCopyRight&chr(13)&_
               PROCopyRightInfo

Select Case Request("action")
  Case "click"
   Call SLIGHTBOY_Click
  Case "add"
   Call SLIGHTBOY_Add
  Case "post"
   Call SLIGHTBOY_Post
  Case "super"
   Call SLIGHTBOY_Super
  Case "admin"
   Call SLIGHTBOY_Admin
  Case "del"
   Call SLIGHTBOY_Del
  Case Else
   Call SLIGHTBOY_Look
End Select

Sub SLIGHTBOY_Look
Call HtmlStart
%>
<body background="pic/bb.gif">
<td align="right" valign="top"><select name="SLIGHTBOY" style="font-size:7pt;font-family:arial" onChange="location.href=this.options[this.selectedIndex].value;" STYLE="BACKGROUND:<%=tdcolor%>;COLOR:<%=trcolor%>">
<%
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
'建立活动游标
Sql = "Select id,name,sex,age,birth,live,counter From wish Order BY id DESC"
'             0   1    2   3      4    5
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,1,1

TotalRecord=Rs.RecordCount
Rs.PageSize=Show
MaxPage=Rs.pagecount

OrderPage=Clng(Request("page"))

IF OrderPage="" or OrderPage=0 then
   OrderPage=1
ElseIF OrderPage > MaxPage Then
   OrderPage=MaxPage
End IF

Response.Write "<option value='wish.asp?page="&OrderPage&"' selected Style=""background:"&trcolor&";color:"&tdcolor&""">PAGE"&OrderPage&"</option>"
 For i= 1 TO MaxPage
  Response.Write "<option value='wish.asp?page="&i&"'>PAGE"&i&"</option>"
 Next
%>
</select>共 <font color="<%=tdcolor%>"><b><%=TotalRecord%></b></font> 瓶 | 语法: <font color="<%=tdcolor%>"><b><%=use_html%></b></font> | 每页<font color="<%=tdcolor%>"><b><%=show%></b></font> 瓶
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="400" background="pic/bg.jpg" height="300" style="border:1 solid black">
<tr>
<td height="230">
<%
IF Session("BottleAdmin")=True Then
Response.Write "<form method=""post"" action=""wish.asp?action=del"">"
End IF

IF not Rs.eof Then
IF OrderPage <> 1 Then
Rs.Move (OrderPage-1)*Show
End IF
i=1

randomize

Do While not Rs.eof and i<=Show

randnum = Int(8*rnd+1)

IF Rs("sex")="m" Then
sexpic="♂"
Else
sexpic="♀"
End IF
IF Session("BottleAdmin")=True Then
Response.Write "<input type=""checkbox"" name=""Del"" value="""&Rs("id")&""">"
End IF
Response.Write "<marquee scrollamount="""&randnum&""" delay=""0"">"&_
"<a href=""wish.asp?action=click&number="&Rs("id")&""" ONMOUSEOVER=""pop('今年"&Rs("age")&"岁住在"&Rs("live")&"的"&Rs("name")&sexpic&"许了一个愿...<br>有"&Rs("counter")&"人看过','"&trcolor&"')"";  ONMOUSEOUT=""kill()"">"&_
"<img src=""pic/c"&Rs("birth")&".gif"" border=""0""></a>"&_
"</marquee>"&chr(13)
i=i+1
Rs.MoveNext
Loop
End IF
Rs.Close
Set Rs=Nothing
conn.Close
Set conn=Nothing
%>
<%
IF Session("BottleAdmin")=True Then
Response.Write "<p align=center>"
Response.Write "<input type=""submit"" value="" 删除 "" style=""HEIGHT:22PX;BACKGROUND-COLOR:"&trcolor&";BORDER:1 SOLID BLACK"">"&chr(13)
Response.Write "</form>"
End IF
Call HtmlEnd
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Click
Call HtmlStart
%>
<td align="right" valign="top">
</td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="400" background="pic/bg.jpg" height="300" style="border:1 solid black">
<tr>
<td height=230>
<%
'建立数据库连接
Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
'建立活动游标
Sql = "Select * From wish Where id="&Clng(Request.Querystring("number"))
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,1,3
birth=Rs("birth")
msg=Rs("msg")
IF Rs("sex")="m" Then
sexpic="先生"
Else
sexpic="小姐"
End IF
IF Rs("email")<>"" Then
info= Rs("age")&"岁的 <a href=""mailto:"&Rs("email")&""">"&Rs("name")&"</a> "&sexpic&",来自"&Rs("live")&",于"&Rs("date")&" 留下此愿"
Else
info= Rs("age")&"岁的 "&Rs("name")&" "&sexpic&",来自"&Rs("live")&",于"&Rs("date")&" 留下此愿"
End IF
Rs("counter")=Rs("counter")+1
Rs.Update
Rs.Close
Set Rs=Nothing
conn.Close
Set conn=Nothing
%>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height=180>
<tr>
<td width="400" style="background-color:white;Filter:Alpha(opacity=40)">
<table border=0 align=center>
<tr>
<td rowspan=2 valign=top>
<img src="pic/c<%=birth%>.gif" align=absmiddle></td>
<td><%=info%></td>
</tr>
<tr>
<td><%=msg%></td>
</tr>
</table>
</td>
</tr>
</table>
<%
Call HtmlEnd
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Admin
'IF Request.Form("id")="" Then Error("您忘了填写名字")
'IF Request.Form("passid")="" Then Error("您忘了填写密码")
IF Request.Form("id")<>userid or Request.Form("passid")<>userpass Then
Error("密码错误,您不是本站管理员")
Else
Session("BottleAdmin")=True
Response.Redirect "wish.asp"
End IF
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub SLIGHTBOY_Post
IF Request.Form("name")="" Then Error("您忘了填写名字")
IF Instr("'",Request.Form("name")) or Instr("""",Request.Form("name")) Then Error("您名字带有非法字符<br>PS:名字中不能带有 ' 或者 """)
IF Request.Form("sex")="" Then Error("您忘了选择性别")
IF CkAge(Request.Form("age")) = False Then Error("年龄栏只能输入数字")
IF Request.Form("live")="" Then Error("您忘了选择居住地")
IF Request.Form("birth")="" Then Error("您忘了选择愿望类别")
IF Request.Form("msg")="" Then Error("您忘了填写愿望")
IF maxmessage = "" or maxmessage > 255 Then maxmessage=255
IF Len(Request.Form("msg"))> maxmessage Then Error("您的愿望太长了")

IF use_html="ON" Then
msg=HTMLcode(Request.Form("msg"))
Else
msg=HTMLEncode(Request.Form("msg"))
End IF

IF usr_fltbadword="ON" Then msg=CkBadWords(msg)

StrEmail=Request.Form("email")
IF usr_emailcheck="ON" and StrEmail<>"" Then
   IF IsValidEmail(StrEmail)=False Then Error("请输入正确信箱地址")
End IF

Set Conn=server.CreateObject("adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0; data source="&DBpath
Sql = "Select TOP 1 * From wish Order BY id DESC"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,conn,3,3
IF Rs.Eof Then
Rs.AddNew
Rs("name")=Trim(Replace(Request.Form("name"),"'",""))
Rs("sex")=Request.Form("sex")
Rs("age")=Request.Form("age")
Rs("birth")=Request.Form("birth")
Rs("email")=StrEmail
Rs("live")=Request.Form("live")
Rs("msg")=msg
Rs("date")=now+time_ctrl
Rs.Update
Else
 IF Rs("msg")=msg Then
 Error("请勿重覆登录")
 Else
 Rs.AddNew
 Rs("name")=Request.Form("name")
 Rs("sex")=Request.Form("sex")
 Rs("age")=Request.Form("age")
 Rs("birth")=Request.Form("birth")
 Rs("email")=StrEmail
 Rs("live")=Request.Form("live")
 Rs("msg")=msg
 Rs("date")=now+time_ctrl
 Rs.Update
 End IF 
End IF
Rs.Close
Set Rs=Nothing
conn=Close
Set conn=Nothing

Call HtmlStart
Response.Write "<td align=""right"" valign=""top"">"&chr(13)&_
"</td>"&chr(13)&_
"</tr>"&chr(13)&_
"</table>"&chr(13)&_
"</center>"&chr(13)&_
"</div>"&chr(13)&_

⌨️ 快捷键说明

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