请大家帮忙查查错误,谢谢了

作者在 2008-07-17 02:35:05 发布以下内容
本人啊菜,
 
不知道是在哪里有错误,请大家帮我看看好吗?谢谢了
 
<%
  Option Explicit
  ip=Replace(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),"'","")
  If ip=Empty Then ip=Replace(Request.ServerVariables("REMOTE_ADDR"),"'","")
  uname=Request.Form("user_name")
  content=Request.Form("user_message")
 
  If Request.Form("user_qq") Then
 
  qq=Request.Form("user_qq")
  
  ELSE
 
  qq="00000000"
 
  End If
  title=Request.Form("user_title")

  If uname=="" Then Response.Write "<script language='javascript'>alert('姓名不能为空');location='index.asp';</script>"
  If content=="" Then Response.Write "<script language='javascript'>alert('留言不能为空');location='index.asp';</script>"
  If title=="" Then Response.Write "<script language='javascript'>alert('标题不能为空');location='index.asp';</script>"
 
  if uname<>"" and content<>"" and title<>"" then
  %>
 
  <!-- #include file="include/conn.asp" -->
 
  <%    SET rs=server.CreateObject("adodb.recordset")
        sql="insert into contents (name,content,ip,title,qq) values ('"&uname&"','"&content&"','"&ip&"','"&title&"','"&qq&"')"
        conn.Execute(sql)
  conn.CLOSE
        response.redirect("index.asp")
     ELSE
       Response.Write "<script language='javascript'>alert('信息填写不全');location='index.asp';</script>"
  End If
%>
学习ASP | 阅读 3485 次
文章评论,共0条
游客请输入验证码
浏览181707次