ASP留言代码.docx

上传人:b****6 文档编号:8745915 上传时间:2023-05-14 格式:DOCX 页数:14 大小:25.21KB
下载 相关 举报
ASP留言代码.docx_第1页
第1页 / 共14页
ASP留言代码.docx_第2页
第2页 / 共14页
ASP留言代码.docx_第3页
第3页 / 共14页
ASP留言代码.docx_第4页
第4页 / 共14页
ASP留言代码.docx_第5页
第5页 / 共14页
ASP留言代码.docx_第6页
第6页 / 共14页
ASP留言代码.docx_第7页
第7页 / 共14页
ASP留言代码.docx_第8页
第8页 / 共14页
ASP留言代码.docx_第9页
第9页 / 共14页
ASP留言代码.docx_第10页
第10页 / 共14页
ASP留言代码.docx_第11页
第11页 / 共14页
ASP留言代码.docx_第12页
第12页 / 共14页
ASP留言代码.docx_第13页
第13页 / 共14页
ASP留言代码.docx_第14页
第14页 / 共14页
亲,该文档总共14页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

ASP留言代码.docx

《ASP留言代码.docx》由会员分享,可在线阅读,更多相关《ASP留言代码.docx(14页珍藏版)》请在冰点文库上搜索。

ASP留言代码.docx

ASP留言代码

ASP留言代码(留言网页界面制作)

ASP留言代码1

1.制作留言界面book.asp1

2.制作连接数据库的中介conn.asp界面9

3.新建一个数据库9

ASP留言代码

1.制作留言界面book.asp

代码如下

--#includefile="conn.asp"-->

DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:

//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

//www.w3.org/1999/xhtml">

ASP留言代码

--

body{

margin-left:

0px;

margin-top:

0px;

margin-right:

0px;

margin-bottom:

0px;

}

a:

link{

text-decoration:

none;

}

a:

visited{

text-decoration:

none;

}

a:

hover{

text-decoration:

none;

}

a:

active{

text-decoration:

none;

}

body,td,th{

font-size:

12px;

}

-->

--

functionMM_preloadImages(){//v3.0

vard=document;if(d.images){if(!

d.MM_p)d.MM_p=newArray();

vari,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i

if(a[i].indexOf("#")!

=0){d.MM_p[j]=newImage;d.MM_p[j++].src=a[i];}}

}

//-->

<%dimrndnum,verifycode

Randomize

DoWhileLen(rndnum)<4

num1=CStr(Chr((57-48)*rnd+48))

rndnum=rndnum&num1

loop

session("verifycode")=rndnum

%>

<%

ifRequest("work")="add"then

verifycode=trim(Request.Form("verifycode"))

verifycode2=trim(Request.Form("verifycode2"))

ifverifycode<>verifycode2then

Response.Write""

Response.Write"alert('验证码错误!

');"

Response.Write"history.go(-1);"

Response.Write""

else

session("verifycode")=""

setrs=server.createobject("adodb.recordset")

sql="select*fromliuyan"

rs.opensql,conn,3,3

rs.addnew

rs("B_name")=Request("B_name")

rs("B_msn")=Request("B_msn")

rs("B_mail")=Request("B_mail")

rs("B_tel")=Request("B_tel")

rs("B_dom")=Request("B_dom")

rs.update'更新数据表记录

Response.Redirect"book.asp"

EndIF

Endif

%>

姓名:

color="#ff6600">*

留言信息:


QQ:

 

color="#ff6600">*

E-mail:

 

color="#ff6600">*

电话:

 

color="#ff6600">*

验证码:

 

1441

搜索:

 [===信息列表===]

 

<%

shou=Request("shou")

ifshou=""then

sql="select*fromliuyanorderbyidDESC"

else

sql="select*fromliuyanwhereB_namelike'%"&shou&"%'orB_domlike'%"&shou&"%'orderbyidDESC"

endif

setrs=server.createobject("adodb.recordset")

rs.opensql,conn,1,1

IFNotrs.eofThen

proCount=rs.recordcount

rs.PageSize=3'定义显示数目

ifnotIsEmpty(Request("ToPage"))then

ToPage=CInt(Request("ToPage"))

ifToPage>rs.PageCountthen

rs.AbsolutePage=rs.PageCount

intCurPage=rs.PageCount

elseifToPage<=0then

rs.AbsolutePage=1

intCurPage=1

else

rs.AbsolutePage=ToPage

intCurPage=ToPage

endif

else

rs.AbsolutePage=1

intCurPage=1

endif

intCurPage=CInt(intCurPage)

Fori=1tors.PageSize

ifrs.EOFthen

ExitFor

endif

%>

 

<%=rs("B_name")%>在(<%=rs("B_date")%>)

 

<%=rs("B_dom")%>


<%iftrim(rs("B_hui"))<>""then%>

管理员回复

:


<%=rs("B_hui")%>

<%endif%>

<%

rs.MoveNext

next

%>

 

9pt;">共:

<%=rs.PageCount%>页,<%=proCount%>信息,第<%=intCurPage%>页

<%ifintCurPage<>1then

%>

|上一页|

<%endif

ifintCurPage<>rs.PageCountthen%>

下一页|尾页|

<%endif%>

<%

else

%>

尚无任何留言!

[===<%=Request("shou")%>===]

<%

endif

rs.close

setrs=nothing

%>

functioncheck()

{

if(document.Form1.B_name.value=="")

{

alert("Inputyourname!

")

document.Form1.B_name.focus()

document.Form1.B_name.select()

return

}

if(document.Form1.B_msn.value=="")

{

alert("InputyourMSN!

")

document.Form1.B_msn.focus()

document.Form1.B_msn.select()

return

}

if(document.Form1.B_mail.value=="")

{

alert("InputyourEmail!

")

document.Form1.B_mail.focus()

document.Form1.B_mail.select()

return

}

if(document.Form1.B_tel.value=="")

{

alert("InputyourTel!

")

document.Form1.B_tel.focus()

document.Form1.B_tel.select()

return

}

if(document.Form1.B_dom.value=="")

{

alert("Inputyourmessage!

")

document.Form1.B_dom.focus()

document.Form1.B_dom.select()

return

}

document.Form1.submit()

}

2.制作连接数据库的中介conn.asp界面

<%

dimconn,db

dimconnstr

db="Data.mdb"'数据库文件位置

onerrorresumenext

connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={MicrosoftAccessDriver(*.mdb)};"

setconn=server.createobject("ADODB.CONNECTION")

iferrthen

err.clear

else

conn.openconnstr

endif

subCloseConn()

conn.close

setconn=nothing

endsub

%>

3.新建一个数据库

新建一个Access数据库,数据库命名为Data.mdb,制作一个表liuyan,其设计图如下图

~\(≧▽≦)/~啦啦~~~~亲爱的读友们,是不是已经做出来了呢?

很简单对吧?

嘻嘻

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2