?? 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 + -