本人小白,刚刚开始学做网站,在html页面里调用一个最简单的留言板,但显示时经常有的输入点击不了,求大侠们给点提点吧>_>,新手没什么分,大家帮我下忙啊。
代码如下:
在线留言
姓
nam名:
联系方式:
留言主题:
留言内容:
回复讨论(解决方案) 来位大侠帮帮我呀~~
贴清楚代码啊。。
没看懂上面代码
贴清楚代码啊。。
没看懂上面代码 谢谢关注
原是asp的一个简单留言板,我是想只引用填写留言这一项,另因为本人不懂这一块,所以属于硬搬的代码,真不好意思,我就是把这里面一部分asp代码给搬到html页里了,这样解释可以么,再次谢谢了,因为这个回复不能太长,我把那个asp的代码分两次贴下吧。
nbsp;html public -//w3c//dtd xhtml 1.0 transitional//en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd>
留言板
call creconn(conn)
action=formatrequest(1,action,1,)
select case action
case add
call add()
case saveadd
call saveadd()
case login
call login()
case chklogin
call chklogin()
case editpwd
call editpwd()
case savepwd
call savepwd()
case loginout
call loginout()
case reply
call reply()
case savereply
call savereply()
case del
call del()
case else
call main()
end select
sub main()
page=formatrequest(1,page,0,1)
if page psize=10
tbname=book_list
getcol=id,username,title,content,adddate,reply,homepage,email
pcol=id
sortcol=id
strw=isshow=true
ct=
tcount=conn.execute(select count(id) from book_list where isshow=true)(0)
pcount=getpagecount(tcount,psize)
if page>pcount and pcount>0 then page=pcount
pindex=page
set rs=conn.execute(getpagelist(tbname,getcol,pcol,sortcol,1,strw,psize,pindex))
if not rs.eof then
%>
签写留言 管理登录修改密码退出登录
do while not rs.eof
%>
留言主题
留言者: target=_blank>
留言时间:
留言内容
)%>
tmpreply=rs(5)
if trim(tmpreply) then
%>
管理员回复
if session(aduser) then
%>
留言管理
电子邮件: target=_blank>
&page= style=color:#f00>回复留言&page= style=color:#f00>删除留言
rs.movenext
loop
%>
if pcount>1 then
response.write pagelist(3,pcount,page,ct)
else
response.write
end if
else
response.write
没有留言
我要签写留言
end if
end sub
sub add()
%>
返回留言列表
姓 名:
联系方式:
留言主题:
留言内容:
end sub
sub saveadd()
username=formatrequest(2,username,1,)
email=formatrequest(2,email,1,)
title=formatrequest(2,title,1,)
content=formatrequest(2,content,1,)
conn.execute(insert into book_list(username,title,content,email,ip) values('&username&','&title&','&content&','&email&','&get_userip()&'))
call showerrmsg(1,留言成功!,index-book.asp)
end sub
sub login()
%>
管理员登录返回留言列表
用户名:
密码:
end sub
sub chklogin()
username=formatrequest(2,username,1,)
userpwd=md5(request.form(userpwd))
set rs=conn.execute(select upwd from ad_list where uname='&username&')
if not rs.eof then
upwd=rs(0)
if userpwdupwd then
call showerrmsg(3,密码错误!,)
else
session(aduser)=username
conn.execute(update ad_list set logindate='&now()&',loginip='&get_userip()&' where uname='&username&')
call showerrmsg(1,登录成功!,index-book.asp)
end if
else
call showerrmsg(3,用户不存在!,)
end if
rs.close
set rs=nothing
end sub
sub editpwd()
if session(aduser)= or isnull(session(aduser)) then call showerrmsg(3,非法操作!,)
%>
修改密码退出登录返回留言列表
用户名: maxlength=30>
旧密码:
新密码:
end sub
sub savepwd()
if session(aduser)= or isnull(session(aduser)) then call showerrmsg(3,非法操作!,)
oldpwd=md5(request.form(oldpwd))
newpwd=md5(request.form(newpwd))
set rs=conn.execute(select upwd from ad_list where uname='&session(aduser)&')
if not rs.eof then
upwd=rs(0)
if oldpwdupwd then
call showerrmsg(3,旧密码错误!,)
else
conn.execute(update ad_list set upwd='&newpwd&' where uname='&session(aduser)&')
call showerrmsg(1,修改成功!,index-book.asp)
end if
else
call showerrmsg(3,用户不存在!,)
end if
rs.close
set rs=nothing
end sub
sub loginout()
session(aduser)=
call showerrmsg(2,,index-book.asp)
end sub
sub reply()
if session(aduser)= or isnull(session(aduser)) then call showerrmsg(3,非法操作!,)
id=formatrequest(1,id,0,0)
page=formatrequest(1,page,0,1)
set rs=conn.execute(select username,title,content,adddate,reply from book_list where id=&id)
if rs.eof then call showerrmsg(3,留言不存在!,)
%>
style=color:#ff0000; text-decoration:underline>返回留言列表
留言主题
留言者:
留言时间:
留言内容
)%>
>
>
管理员回复
rs.close
set rs=nothing
end sub
sub savereply()
if session(aduser)= or isnull(session(aduser)) then call showerrmsg(3,非法操作!,)
id=formatrequest(2,id,0,0)
page=formatrequest(2,page,0,0)
tmpreply=formatrequest(2,reply,1,)
if tmpreply= then call showerrmsg(3,请输入回复内容!,)
conn.execute(update book_list set reply='&tmpreply&' where id=&id)
call showerrmsg(1,回复成功!,index-book.asp?page=&page)
end sub
sub del()
id=formatrequest(1,id,0,0)
page=formatrequest(1,page,0,0)
conn.execute(delete from book_list where id=&id)
call showerrmsg(1,删除成功!,index-book.asp?page=&page)
end sub
call cloconn(conn)
%>
同求这个问题的解决方法,希望能得个答案~
解决不了 ,看来,结个贴算了,自个琢磨去,谢谢大家的关注~