📄 fill_ad1.asp
字号:
<%
DIM username,password
username=TRIM(Request.Form("username"))
password=TRIM(Request.Form("password"))
'再次检查口令和用户名是否为空
On Error Goto 0
if username=""or password="" then
response.redirect "../syspages/error_nouser.htm"
'错误:用户名或口令为空
else
Set con=Server.CreateObject("ADODB.Connection")
con.Open Application("DBCon_ConnectionString")
'检查是否存在此用户,及是否有效
strSql="select * from yonghu where yonghu='"+username+"' and kouling='"+password+"'"
Set rs=con.Execute(strSql)
if rs.EOF then '错误:没有这个用户
response.redirect "../syspages/error_nothisuser.htm"
end if
if rs("youxiao")=2 then '已经发布了一条广告
strSql="SELECT * FROM guanggao where yonghu='"+username+"' "
Set rs1=con.Execute(strSql)
Session("modify")=1 '标志
end if
if rs("youxiao")<=0 then '无效
response.redirect "../syspages/error_invalid.htm"
end if
session("username")=username
end if
%>
<html>
<head>
<title>找一找——发布广告</title>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function form1_onsubmit() {
return check();
}
function check()
{
var form=document.form1;
if(form.dianhua.value.length>0)
{
if(!JudgePhone(form.dianhua.value))
{
window.alert("请输入合法电话!");
form.dianhua.focus();
return false;
}
}
if(form.e_mail.value.length>0)
{
//if(JudgeEmail(form.e_mail.value))
//{
// window.alert("请输入正确的电子邮件地址!");
// form.e_mail.focus();
// return false;
//}
return true;
}
if(form.neirong.value.length<=0)
{
window.alert("请输入广告内容!");
form.neirong.focus();
return false;
}
if(form.neirong.value.length>600)
{
window.alert("广告长度不得大于300字!");
form.neirong.focus();
return false;
}
if(form.fenlei1.value=="0")
{
window.alert("请选择广告分类!");
form.fenlei1.focus();
return false;
}
return true;
}
//判断电话号码有效性
function JudgePhone(strPass)
{
var array,intTmp,strTmp,i;
var re1=/0/gi;
strPass=strPass.replace(re1,"1");
array=strPass.split("-");
for (i=0;i<array.length;i++)
{
intTmp=parseFloat(array[i]);
strTmp=intTmp.toString();
if (strTmp.length!=array[i].length)
return false;
}
return true;
}
//判断E-mail有效性
function JudgeEmail(strPass)
{
var array,strTmp,re1,re2;
re1=/@/i;
if (strPass.search(re1)==-1)
return false;
array=strPass.match(re1);
return true;
//if (array.length==1)
//{
// re2=/\./i;
// if (strPass.search(re1)<strPass.search(re2))
// return true;
//}
//return false;
}
function changeClass()
{
}
//-->
</SCRIPT>
<link rel="stylesheet" href="../html/3508.css">
<style type="text/css">
<!--
.botton { font-size: 12px; color: #000000; background-color: #FFFFE8}
-->
</style>
</head>
<body background="../images/bg1.gif">
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td width="217" height="39" align="center" valign="bottom"><img src="../images/smallmark.gif" width="120" height="25"></td>
<td width="523" valign="bottom" height="39"><a href="../default.asp">本站首页</a>
>> 供求信息</td>
</tr>
<tr>
<td colspan="2" height="1" bgcolor="006600"></td>
</tr>
</table>
<p><%=username%>,您好! </p>
<p><此处为发布广告的说明及注意事项></p>
<form method="post" action="add_ad.asp" id=form1 name=form1 LANGUAGE=javascript onsubmit="return form1_onsubmit()">
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center" height="15">
<tr>
<td height="16" width="54%">联系人:
<input name="lianxiren" size="11"
value="<%if rs("youxiao")=2 then%><%=rs1("lianxiren")%><%else%><%=rs("lianxiren")%><%end if%>">
* </td>
<td height="16" width="46%">电话:
<input name="dianhua" size="16"
value="<%if rs("youxiao")=2 then%><%=rs1("dianhua")%><%else%><%=rs("dianhua")%><%end if%>">
*</td>
</tr>
<tr>
<td height="16" width="54%">地 址:
<input name="dizhi" size="30"
value="<%if rs("youxiao")=2 then%><%=rs1("dizhi")%><%else%><%=rs("dizhi")%><%end if%>">
*</td>
<td height="16" width="46%">邮编:
<input name="youbian" size="9"
value="<%if rs("youxiao")=2 then%><%=rs1("youbian")%><%else%><%=rs("youbian")%><%end if%>">
*</td>
</tr>
<tr>
<td height="16">国 家:
<input name="guojia" size="11"
value="<%if rs("youxiao")=2 then%><%=rs1("guojia")%><%else%><%=rs("guojia")%><%end if%>">
</td>
<td height="16">城市:
<input name="chengshi" size="9"
value="<%if rs("youxiao")=2 then%><%=rs1("chengshi")%><%else%><%=rs("chengshi")%><%end if%>">
* </td>
</tr>
<tr>
<td height="16" colspan="2">E_mail:
<input name="e_mail"
value="<%if rs("youxiao")=2 then%><%=rs1("chengshi")%><%else%><%=rs("e_mail")%><%end if%>"
size="23" >
*</td>
</tr>
<tr>
<td height="16">广告内容:*</td>
<td height="16"> </td>
</tr>
<tr>
<td height="16" colspan="2">
<textarea cols=80 name=neirong rows=9
><%if rs("youxiao")=2 then%><%=replace(rs1("neirong"),"<br>",vbcrlf)%><%end if%></textarea>
</td>
</tr>
<tr>
<td height="16" colspan="2">代理商/分公司/连锁店:
<input name="dailishang" size="60"
value="<%if rs("youxiao")<=0 then%><%=rs1("dailishang")%><%end if%>">
</td>
</tr>
<tr>
<td height="16">分类:
<select name="fenlei1" size="1" onChange="changeClass()">
<%if rs("youxiao")>0 then%><option value="0">--请选择类别--</option><% end if%>
<option value="电脑及配件" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="电脑与配件" then%>selected<%end if%><% end if%>>电脑及配件</option>
<option value="电脑耗材及外设" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="电脑耗材及外设" then%>selected<%end if%><% end if%>>电脑耗材及外设</option>
<option value="网络产品" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="网络产品" then%>selected<%end if%><% end if%>>网络产品</option>
<option value="电脑服务及软件" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="电脑服务及软件" then%>selected<%end if%><% end if%>>电脑服务及软件</option>
<option value="房屋" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="房屋" then%>selected<%end if%><% end if%>>房屋</option>
<option value="车辆及维修" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="车辆及维修" then%>selected<%end if%><% end if%>>车辆及维修</option>
<option value="通讯器材" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="通讯器材" then%>selected<%end if%><% end if%>>通讯器材</option>
<option value="家用电器" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="家用电器" then%>selected<%end if%><% end if%>>家用电器</option>
<option value="办公用品" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="办公用品" then%>selected<%end if%><% end if%>>办公用品</option>
<option value="美容健身" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="美容健身" then%>selected<%end if%><% end if%>>美容健身</option>
<option value="餐饮娱乐" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="餐饮娱乐" then%>selected<%end if%><% end if%>>餐饮娱乐</option>
<option value="五金交电" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="五金交电" then%>selected<%end if%><% end if%>>五金交电</option>
<option value="装修装饰" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="装修装饰" then%>selected<%end if%><% end if%>>装修装饰</option>
<option value="中介代理" <%if rs("youxiao")<=0 then%><%if rs1("fenlei1")="中介代理" then%>selected<%end if%><% end if%>>中介代理</option>
</select>
</td>
<td height="16">详细分类:
<input name="fenlei2" size="23"
value="<%if rs("youxiao")<=0 then%><%=rs1("fenlei2")%><%end if%>">
</td>
</tr>
<tr>
<td height="16" colspan="2"> </td>
</tr>
<tr align="center">
<td height="16" colspan="2">
<input type="hidden" name="youxiao"
value="<%if rs("youxiao")<=0 then%><%=rs("youxiao")%><%end if%>">
<input type="reset" value="重填" id=button1 name=button1 class="botton"> <input type="submit" value="发布" id=submit1 name=submit1 class="botton">
</td>
</tr>
</table>
</form>
<!-- #include file="../include/end.htm" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -