add_info_pl.asp

来自「CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。」· ASP 代码 · 共 137 行

ASP
137
字号
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="add_config.asp" -->
<!--#include file="sub_change.asp" -->
<!--#include file="ad.asp" -->
<%
if siteread="yes" then response.redirect "error.asp?v=siteread"  end if

dim id,ok
id=strchange(trim(request.QueryString("id")))
ok=strchange(left(trim(request.QueryString("ok")),1))
if len(id)=0 or IsNumeric(id)=flase then response.redirect "error.asp?v=infomore_error" end if

dim errormax,name,namemax,lianxi,lianximax,about,aboutmax,lianxi1,niming,userip
namemax=10
lianximax=100
aboutmax=240
errormax=""

if ok="y" then
  name=strchange(trim(request.form("name")))
  if len(name)=0 then errormax=errormax&"您的大名不能为空!<br>" end if
  if len(name)>namemax then errormax=errormax&"您的大名超过系统最大字符数" &namemax&",目前字符数:"&len(name)&"!<br>" end if
  if len(guolv(name))>0 then errormax=errormax&"您的大名中数据“"&guolv(name)&"”被系统过滤!<br>" end if
  
  niming=strchange(trim(request.form("niming")))
  
  lianxi1=strchange(trim(request.form("lianxi1")))
  lianxi=strchange(trim(request.form("lianxi")))
  if len(lianxi)>lianximax then errormax=errormax&"联系方式超过系统最大字符数" &lianximax&",目前字符数:"&len(lianxi)&"!<br>" end if
  if len(guolv(lianxi))>0 then errormax=errormax&"联系方式中数据“"&guolv(lianxi)&"”被系统过滤!<br>" end if
  if lianxi1<>"暂时不留" and lianxi="" then errormax=errormax&"您填写<u>"&lianxi1&"</u>的联系方式,如不想留联系方式请选择<u>暂时不留</u><br>" end if
  
  about=strchange(trim(request.form("about")))
  if len(about)=0 then errormax=errormax&"发言内容不能为空!<br>" end if
  if len(about)>aboutmax then errormax=errormax&"发言内容超过系统最大字符数" &aboutmax&",目前字符数:"&len(about)&"!<br>" end if
  if len(guolv(about))>0 then errormax=errormax&"发言内容中数据“"&guolv(about)&"”被系统过滤!<br>" end if
  
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") 

    
  if len(errormax)>0 then 
    errormax="抱歉:以下字段数据需要修改。<br>" & errormax
  else
    if lianxi1="暂时不留" then
      lianxi="未留"
    else
      lianxi=lianxi1& ":" &lianxi
    end if
    
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select * from 资讯评论",conn,3,3
    rs.addnew
    rs("资讯编号")=id
    rs("发言者姓名")=name
    rs("匿名")=niming
    rs("发言者联系方式")=lianxi
    rs("发言内容")=about
    rs("发言时间")=now()
    rs("ip")=userip
    rs("审核")=siteplpass
    rs.update
    rs.close
    set rs=nothing
    
    response.write "<center style='font-size: 12pt; line-height:20pt'>感谢您添加评论!马上返回该资讯...<br><a href='infomore.asp?id="&id&"'>&gt;&gt;不想等待请点击这里返回&lt;&lt;</a></center><meta http-equiv=refresh content=5;URL='infomore.asp?id="&id&"'>" 
    response.end
  end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=keywords content="<%=sitekeywords%>">
<meta name="description" content="<%=sitedescription%>">
<title>发表评论 --------------------- <%=sitename%></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="2">
<div align="<%=sitealign%>"> 
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="500" bordercolor="#CCCCCC">
<form method="POST" action="?id=<%=id%>&ok=y" name="add_infopl" target="_parent">
  <tr>
	<td style="font-size: 10pt" bgcolor="#EFEFEF" colspan="2"><font face="Wingdings" style="font-size: 12pt" color="#FF9800">&icirc;</font>
	<font color="#FF6600"><b>发表评论</b></font></td>
  </tr>
  <tr>
    <td height="28" colspan="2"><b><%=msg_add_info_pl%></b><br><font color="red"><%=errormax%></font></td>
  </tr>
  <tr>
    <td width="100" align="center">您的大名:</td>
    <td width="400"><input type="text" name="name" size="24" value="<%=name%>"> <font color="#FF3300">*</font>(如:张三,Tom。。最多<%=namemax%>字符)</td>
  </tr>
  <tr>
    <td align="center">匿名发表:</td>
    <td><input type="checkbox" name="niming" value="-1" <%if niming="-1" then response.write "checked"%> readonly checked>目前是匿名发表</td>
  </tr>
  <tr>
    <td align="center">联系方式:</td>
    <td>
      <select size="1" name="lianxi1">
    	<%if lianxi1<>"" then response.write "<option value='"&lianxi1&"' checked>"&lianxi1&"</option>"%>
        <option value="暂时不留">暂时不留</option>
        <option value="手机">手机</option>
        <option value="电话">电话</option>
        <option value="Email">Email</option>
        <option value="QQ">QQ</option>
        <option value="MSN">MSN</option>
        <option value="其他">其他</option>
      </select> 
	  <input type="text" name="lianxi" size="35"  value="<%=lianxi%>"><br>如果选择暂时不留,请保持后面文本框为空,最多<%=lianximax%>字符</td>
  </tr>
  <tr>
    <td align="center">发表内容:</td>
    <td><textarea rows="5" name="about" cols="45"><%=about%></textarea><br><font color="#FF3300">*</font>最多<%=aboutmax%>字符</td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="submit" value=" 发表评论 " name="add">&nbsp;&nbsp;&nbsp;&nbsp; <input type="button" value=" 重  置 " name="reset" onclick="window.location='?id=<%=id%>'"></td>
  </tr>
  <tr>
    <td colspan="2" align="center" height="2"></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><input type="button" value=" 返回资讯 " name="back" onclick="window.location='infomore.asp?id=<%=id%>'">&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" value=" 返回评论 " name="back1" onclick="window.location='infomore_pl.asp?id=<%=id%>'"></td>
  </tr>
</form>
</table>
<table width="500"><tr><td height="2"></td></tr></table>
<table width="500"  border="1" cellpadding="8" style="border-collapse: collapse" bordercolor="#CCCCCC">
  <tr><td height="2" align="center"><!--详细页广告--><%call ad_info_more("城市名")%></td></tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?