| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1459 人关注过本帖
标题:请高人指点:您5分钟时间解决一个困扰我n天的问题
只看楼主 加入收藏
qiguai99
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-1-25
收藏
 问题点数:0 回复次数:3 
请高人指点:您5分钟时间解决一个困扰我n天的问题
请高人指点:您5分钟时间解决一个困扰我n天的问题

这是个分类信息发布的代码,在检验提交的表单时,请各位高人帮我修改成 只有提交的表单的“内容”(有标题、时间、联系人等字段)包含字符“我”,才能允许提交或提交成功
(下面代码中的应该是括号啊,不知怎么回事)
文件一 addmesg.asp


<%session("ad"=0%>
<!--#include file="top.htm"-->

<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<style>
<!--
td { font-size: 9pt }
A:link {text-decoration: none; color:#000000}
A:visited {text-decoration: none; color: #000000}
A:active {text-decoration: none; color: #FF0000}
A:hover {text-decoration: underline; color: FF0000}
-->
</style>

<div align="center">
<center>
<table width="778" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="540" valign="top" bgcolor="#F4FBF8">
<table width="520" border="0" align="center">

<tr>
<td width="100%" valign="top" class=f14 ><strong><font color="#FF6600">·发布信息</font></strong></td>
</tr>
<tr>
<td width="100%" valign="top"> <p style="color: #FF0000">
注意:1、请严格遵守互联网相关法律法规,严禁发布政治、色情、暴力等与本网站无关的       信息,违者本网站一律删除,并保留追究法律责任的权利。</p>
<div align="left">
<blockquote>
<p><span style="color: #FF0000">   2、以下各项都必须填写</span><font color="#FF0000"><br>

<%if request("w"=1 then response.write "请选择供求!"
if request("w"=2 then response.write "主题不能为空!"
if request("w"=3 then response.write "联系人不能为空!"
if request("w"=4 then response.write "联系电话不能为空!"
if request("w"=5 then response.write "内容不能为空!"
if request("w"=6 then response.write "内容超过1000个字母!"%>




</font>
</p>
</blockquote>
</div>
<form method="POST" action="addmed.asp">
<table width="450" border="0" align="center" cellpadding="1" cellspacing="2">
<tr>
<td>选择分类:</td>
<td>
<select size="1" name="n" style="background-color: #FFFFE6">
<option value="1">原料</option>
<option value="2">包装</option>
<option value="3">设备</option>
<option value="3">代理</option>
<option value="5">招商</option>
<option value="6">人才</option>
<option value="7">投资</option>
<option value="8">物流</option>
<option value="9">商务</option>
<option value="10">其它</option>
</select>
选择供求:
<input name="gq" type="radio" value="供" checked>

<input type="radio" name="gq" value="求">
求 </td>
</tr>
<tr>
<td width="16%">主 题:</td>
<td width="84%">
<!--webbot
bot="Validation" B-Value-Required="TRUE"
I-Maximum-Length="40" -->
<input type="text" name="t1" size="44" maxlength="40"></td>
</tr>
<tr>
<td width="16%">电子邮件:</td>
<td width="84%">
<!--webbot
bot="Validation" B-Value-Required="TRUE"
I-Maximum-Length="30" -->
<input type="text" name="t2" size="44" maxlength="30"></td>
</tr>
<tr>
<td width="16%">联 系 人:</td>
<td width="84%" height="22">
<!--webbot
bot="Validation" B-Value-Required="TRUE"
I-Maximum-Length="30" -->
<input name="t5" type="text" id="t5" size="10" maxlength="30">
联系电话:
<input type="text" name="t4" size="19" maxlength="30"></td>
</tr>
<tr>
<td width="16%" valign="top">内 容:</td>
<td width="84%" valign="middle">
<textarea rows="6" name="t3" cols="43"></textarea></td>
</tr>
<tr>
<td width="16%">所在地区:</td>
<td width="84%">
<select name="d1" size="1">
<option value="山东" selected>山东</option>
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="天津">天津</option>
<option value="重庆">重庆</option>
<option value="广东">广东</option>
<option value="河北">河北</option>
<option value="山西">山西</option>
<option value="内蒙">内蒙</option>
<option value="辽宁">辽宁</option>
<option value="吉林">吉林</option>
<option value="黑龙江">黑龙江</option>
<option value="江苏">江苏</option>
<option value="浙江">浙江</option>
<option value="安徽">安徽</option>
<option value="福建">福建</option>
<option value="江西">江西</option>
<option value="河南">河南</option>
<option value="湖北">湖北</option>
<option value="湖南">湖南</option>
<option value="广东">广东</option>
<option value="广西">广西</option>
<option value="四川">四川</option>
<option value="贵州">贵州</option>
<option value="云南">云南</option>
<option value="西藏">西藏</option>
<option value="陕西">陕西</option>
<option value="甘肃">甘肃</option>
<option value="青海">青海</option>
<option value="宁夏">宁夏</option>
<option value="新疆">新疆</option>
<option value="台湾">台湾</option>
<option value="香港">香港</option>
<option value="国外">国外</option>
<option value="其它">其它</option>
</select> 有效期限:
<select size="1" name="d2">
<option value="1" selected>1天</option>
<option value="3">3天</option>
<option value="7">1个星期</option>
<option value="15">半个月</option>
<option value="30">1个月</option>
</select></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td width="16%" align="center"> </td>
<td width="84%" align="center"><input type="submit" value="马上发布" name="B1" style="background-color: #FFFFE6; font-size: 9pt; border-style: solid; border-color: #000000">
<input type="reset" value="全部重填" name="B2" style="background-color: #FFFFE6; font-size: 9pt; border-style: solid; border-color: #000000">
</td>
</tr>
</table>
</form>
<p></p></td>
</tr>
</table>
</td>
<td width="209" valign="top" bgcolor="#DCEBE1"><table width="120" border="0" align="center" cellspacing="0">
<tr>
<td width="100%"></td>
</tr>
<tr>
<td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8%"><img src="in4_08.gif" alt="gg" width="11" height="11"></td>
<td width="92%" class=f14 ><font color="#FF3300"><strong>信息搜索</strong></font></td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%" height="44"><form method="POST" action="search.asp">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" align="center"><input name="search" type="text" id="search" size="14">
<input type="submit" name="Submit" value="搜索"></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td width="100%" height="19"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="8%"><img src="in4_08.gif" alt="gg" width="11" height="11"></td>
<td width="92%" class=f14 ><font color="#FF3300"><strong>信息分类</strong></font></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"><table width="96%" border="1" align="center" cellpadding="2" cellspacing="1">
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=1">原料</a><br>
</div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=2">包装</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=3">设备</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=4">代理</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=5">招商</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=6">人才</a> </div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=7">投资</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=8">物流</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=9">商务</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=10">其它</a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><a href="http://www.nhhn.ney/netbiz" target="_blank"></a><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
</table></td>
</tr>
</table>
</center>
</div>

<div align="center">
<center>
</center>
</div>

<div align="center">
<center>
<!--#include file="bottom.htm"-->
</center>
</div>

</body>

</html>


文件二 addmed.asp

<%if trim(request("gq")="" then response.redirect "addmesg.asp?w=1&adwh=" &request("n"
if trim(request("t1")="" then response.redirect "addmesg.asp?w=2&adwh=" &request("n"
if trim(request("t5")="" then response.redirect "addmesg.asp?w=3&adwh=" &request("n"
if trim(request("t4")="" then response.redirect "addmesg.asp?w=4&adwh=" &request("n"
if trim(request("t3")="" then response.redirect "addmesg.asp?w=5&adwh=" &request("n"
if len(request("t3")>1000 then response.redirect "addmesg.asp?w=6&adwh=" &request("n"
%>
<!--#include file="top.htm"-->
<div align="center"><center>

</center>
</div>

<div align="center">
<center>
<table width="778" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="540" valign="top" bgcolor="#F4FBF8">
<table width="520" height="113" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="32" class=f14><strong><font color="#FF6600">·添加成功</font></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class=f14><div align="center"><font color="#FF0000">恭喜!您的信息已经成功能添加到本站信息库!</font></div></td>
</tr>
</table>
<p>
<%set com=server.createobject("adodb.connection"
com.open "DBQ="& Server.MapPath("/database/#da ta.asp" &";Driver={Microsoft Access Driver (*.mdb)};"

t1=replace(request("t1","<","〈"
t1=replace(t1,"'","''"
t2=replace(request("t2","<","〈"
t2=replace(t2,"'","‘’"
t4=replace(request("t4","<","〈"
t4=replace(t4,"'","‘’"
t5=replace(request("t5","<","〈"
t5=replace(t5,"'","‘’"
gq=replace(request("gq","<","〈"
gq=replace(gq,"'","‘’"
n=replace(request("n","<","〈"
n=replace(n,"'","‘’"
d1=replace(request("d1","<","〈"
d1=replace(d1,"'","''"
sz = "'" & t1 & "','" & t2 & "','" & t4 & "','" & t5 & "','" & gq & "','" & request("t3" & "','" & n &"','" & d1 &"','" & now & "',#" & dateadd("d",request("d2",date) & "#"
if session("ad"=0 then com.Execute("INSERT INTO msg ( tit,mal,tel,lxr,gq,msg,kin,whe,tim,edt ) VALUES(" & sz & ""
session("ad"=1%>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td width="220" valign="top" bgcolor="#DCEBE1"><table width="120" border="0" align="center" cellspacing="0">
<tr>
<td width="100%"></td>
</tr>
<tr>
<td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8%"><img src="in4_08.gif" alt="gg" width="11" height="11"></td>
<td width="92%" class=f14 ><font color="#FF3300"><strong>信息搜索</strong></font></td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%" height="44"><form method="POST" action="search.asp">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" align="center"><input name="search" type="text" id="search" size="14">
<input type="submit" name="Submit" value="搜索"></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td width="100%" height="19"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="8%"><img src="in4_08.gif" alt="gg" width="11" height="11"></td>
<td width="92%" class=f14 ><font color="#FF3300"><strong>信息分类</strong></font></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"><table width="96%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=1">原料</a><br>
</div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=2">包装</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=3">设备</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=4">代理</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=5">招商</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=6">人才</a> </div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=7">投资</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=8">物流</a></div></td>
</tr>
<tr>
<td class=f14 ><div align="center"><a href="fl.asp?n=9">商务</a></div></td>
<td class=f14 ><div align="center"><a href="fl.asp?n=10">其它</a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><a href="http://www.nhhn.ney/netbiz" target="_blank"></a><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
<tr>
<td height="19"><div align="center"><img src="ggwzs.gif" alt="gg" width="180" height="55"></div></td>
</tr>
<tr>
<td height="19"> </td>
</tr>
</table></td>
</tr>
</table>
</center>
</div>

<div align="center">
<center>
<!--#include file="bottom.htm"-->
</center>
</div>

</body>

</html>
搜索更多相关主题的帖子: 困扰 高人 时间 
2006-05-22 08:46
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
if Instr(title,"w")&gt;0 then

http://www./
2006-05-22 08:55
qiguai99
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-1-25
收藏
得分:0 
以下是引用hangxj在2006-5-22 8:55:00的发言:
if Instr(title,"w")>0 then

不行啊,是表单的内容,不是标题

2006-05-22 09:27
hangxj
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2045
专家分:0
注 册:2006-4-10
收藏
得分:0 
一样的道理呀,那个title就是你想要比较的

http://www./
2006-05-22 09:35
快速回复:请高人指点:您5分钟时间解决一个困扰我n天的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029349 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved