asp的表单怎么提交不到数据库?后台删除的操作也不行了?
dimactact=request.querystring("act")selectcaseactcase"ok"ifRequest.ServerVariables("H...
dim act
act=request.querystring("act")
select case act
case "ok"
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" then
zhenip=Request.ServerVariables("REMOTE_ADDR")
else
zhenip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
if request("name")="" then
name="游客"
else
name=trim(request("name"))
end if
if request("qq")="" then
qq="无"
else
qq=trim(request("qq"))
end if
if request("email")="" then
email="无"
else
email=trim(request("email"))
end if
set rs_y=server.CreateObject("adodb.recordset")
rs_y.open "select * from laos_ly",conn,1,3
rs_y.AddNew
rs_y("name")=name
rs_y("qq")=qq
rs_y("email")=email
rs_y("contect")=trim(request("contect"))
//rs_y("ip")=zhenip
rs_y.Update
rs_y.Close
set rs_y=nothing
response.write "<script language='javascript'>alert('谢谢你对本站的支持,本站有你更精彩!');this.location.href=book.asp';</SCRIPT>"
end select
后面的
<form id="form" name="form" method="post" action="book.asp?act=ok">
<div class="book_ly_a">网名:<input name="name" type="text" class="wenbenkuang" id="name" onclick="javascript:this.value=''" value="游客" />
QQ:<input name="qq" type="text" class="wenbenkuang" id="qq" onclick="javascript:this.value=''" value="无" />
邮箱:<input name="email" type="text" class="wenbenkuang" id="email" onclick="javascript:this.value=''" value="无" />
</div>
<div class="book_ly_b">
<textarea name="contect" cols="45" rows="5" class="lykuang" id="contect"></textarea>
</div>
<div class="book_ly_c"><input name="button" type="submit" class="lyanniu" id="button" value=" 提交留言 " />
<input name="button" type="reset" class="lyanniu" id="button" value=" 重新填写 " /></div></form>
</div>
<div class="book_view"><%
pagenum=10
set rs=server.createobject("adodb.recordset")
sql="select name,contect,hf,datetime from laos_ly where sh=1 order by datetime desc"
rs.open sql,conn,1,1
if rs.bof and rs.eof then response.write"<div>暂无记录</div>"
i=0
page=cint(request("page"))
if IsNumeric(page) then
page=cint(page)
if page<1 then page=1
else
page=1
end if
rs.pagesize=pagenum
if page="" or page<1 then page=1
total=rs.pagecount
tot=rs.recordcount
if page>total then
page=total
else
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
%>
<div class="book_v_a">
<div class="book_v_b">
<div class="book_v_b_a">网名:<%=rs("name")%></div>
<div class="book_v_b_b">留言时间:<%=year(rs("datetime"))%>年<%=Month(rs("datetime"))%>月<%=day(rs("datetime"))%>日</div>
<div class="clear"></div>
</div>
<div class="book_v_c"><%=rs("contect")%><%if rs("hf")<>"" then%><br /><font color="#CC0000">站长回复:</font><%=rs("hf")%><%end if%></div>
</div>
有头文件<head><!--#include file="inc/conn.asp"--> 展开
act=request.querystring("act")
select case act
case "ok"
if Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" then
zhenip=Request.ServerVariables("REMOTE_ADDR")
else
zhenip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
if request("name")="" then
name="游客"
else
name=trim(request("name"))
end if
if request("qq")="" then
qq="无"
else
qq=trim(request("qq"))
end if
if request("email")="" then
email="无"
else
email=trim(request("email"))
end if
set rs_y=server.CreateObject("adodb.recordset")
rs_y.open "select * from laos_ly",conn,1,3
rs_y.AddNew
rs_y("name")=name
rs_y("qq")=qq
rs_y("email")=email
rs_y("contect")=trim(request("contect"))
//rs_y("ip")=zhenip
rs_y.Update
rs_y.Close
set rs_y=nothing
response.write "<script language='javascript'>alert('谢谢你对本站的支持,本站有你更精彩!');this.location.href=book.asp';</SCRIPT>"
end select
后面的
<form id="form" name="form" method="post" action="book.asp?act=ok">
<div class="book_ly_a">网名:<input name="name" type="text" class="wenbenkuang" id="name" onclick="javascript:this.value=''" value="游客" />
QQ:<input name="qq" type="text" class="wenbenkuang" id="qq" onclick="javascript:this.value=''" value="无" />
邮箱:<input name="email" type="text" class="wenbenkuang" id="email" onclick="javascript:this.value=''" value="无" />
</div>
<div class="book_ly_b">
<textarea name="contect" cols="45" rows="5" class="lykuang" id="contect"></textarea>
</div>
<div class="book_ly_c"><input name="button" type="submit" class="lyanniu" id="button" value=" 提交留言 " />
<input name="button" type="reset" class="lyanniu" id="button" value=" 重新填写 " /></div></form>
</div>
<div class="book_view"><%
pagenum=10
set rs=server.createobject("adodb.recordset")
sql="select name,contect,hf,datetime from laos_ly where sh=1 order by datetime desc"
rs.open sql,conn,1,1
if rs.bof and rs.eof then response.write"<div>暂无记录</div>"
i=0
page=cint(request("page"))
if IsNumeric(page) then
page=cint(page)
if page<1 then page=1
else
page=1
end if
rs.pagesize=pagenum
if page="" or page<1 then page=1
total=rs.pagecount
tot=rs.recordcount
if page>total then
page=total
else
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
%>
<div class="book_v_a">
<div class="book_v_b">
<div class="book_v_b_a">网名:<%=rs("name")%></div>
<div class="book_v_b_b">留言时间:<%=year(rs("datetime"))%>年<%=Month(rs("datetime"))%>月<%=day(rs("datetime"))%>日</div>
<div class="clear"></div>
</div>
<div class="book_v_c"><%=rs("contect")%><%if rs("hf")<>"" then%><br /><font color="#CC0000">站长回复:</font><%=rs("hf")%><%end if%></div>
</div>
有头文件<head><!--#include file="inc/conn.asp"--> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询