ASP传值问题(全代码)
showjsv.asp(内容页 从index.asp传值过来的)<%
pic_id=Request.Querystring("pic_id")
If pic_id ="" then
Response.Write("<script language=javascript>alert('·?·¨·???');window.location.href='index.asp'</script>")
end if
if instr(pic_id,"'") or instr(pic_id,"select") or instr(pic_id,"in") or instr(pic_id,"from") or instr(pic_id,"len") or instr(pic_id,"where") or instr(pic_id,"or") or instr(pic_id,"and") then
Response.Write("<script language=javascript>alert('????×?????');window.location.href='index.asp'</script>")
Response.End
end if
conn.execute("update pic set pic_count=pic_count+1 where pic_id="&pic_id)
sql1="select * from pic where pic_id="&pic_id
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,1,1
if rs1.eof then
Response.Write("??????????????±à??????????????")
Response.end
end if
%> //传值程序结束
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="border: 1px solid #B7B7B7">
<tr>
<td bgcolor="D9D9D9" height="20"> <strong>谈谈你的想法:</strong></td>
</tr>
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5"></td>
</tr><form id="form1" name="form1" method="post" action="lysave.asp">
<tr>
<td>昵称:<input type="text" name="name1">
认证码:<input name="s" type="text" size="10"> <b><%=s%></b>
<input maxlength=20 name="s2" size=12 type=hidden value="<%=s%>"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><textarea name="connect" cols="100" rows="5"></textarea></td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td><div align="right">
<input type="submit" name="tj" value="提交">
<input type="hidden" name="pic_id" value="<%=request.querystring("pic_id")%>">
</div></td>
</tr></form>
<tr>
<td height="5"></td>
</tr>
</table></td>
</tr>
</table> //评论表单结束
lysave.asp(评论表单的程序页)
<%
s=Trim(Request.Form("s"))
s2=Request.Form("s2")
If s2<>s Then
Response.Write("<script language=javascript>alert('请输入正确的认证码!');history.back()</script>")
Response.End
end if
if request("name1")="" then
response.write "<script language='javascript'>alert('昵称不能为空');history.back();</script>"
response.end
end if
if request("connect")="" then
response.write "<script language='javascript'>alert('内容不能为空');history.back();</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [ly]",conn,1,3
rs.addnew
rs("id")=request.Form("pic_id")
rs("connect")=Request.Form("connect")
rs("name1")=trim(request("name1"))
rs("date")=date()
rs.update
rs.close
set rs=nothing
response.write("<script>window.location='showjsv.asp?pic_id="&pic_id&"'</script>")
%>
代码所实现的功能是在某网站一篇文章里面 发表评论.现在能发表评论 但是无法传值回到showjsv.asp(及本身页面) 求高手指点
小弟初学ASP 对传值不太熟悉 不知道贴这些代码对小弟有没有什么帮助 如果有心帮忙又有不太明白的地方可以加QQ274305167 明天小弟全天在线等