?? add_city.asp
字號:
<!--#include file="config.asp" -->
<%
city=trim(request.form("city"))
pov=trim(request.form("pov"))
quhao=trim(request.form("quhao"))
about=trim(request.form("about"))
set rs=server.CreateObject("adodb.recordset")
if len(city)>0 then
rs.open"select * from city where 城市='" &city& "' or 區號='" & quhao & "'",conn,1,1
if not rs.eof then
response.write "<div align=center><a href='javascript:history.back(1)'>該城市已存在,請重新輸入!</a></div>"
response.end
end if
rs.close
rs.open "select * from city",conn,3,3
rs.addnew
rs("城市")=city
rs("省份")=pov
rs("區號")=quhao
rs("簡介")=about
rs("審核")=-1 '0未審核,-1已審核
rs("日期")=date()
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=city"
response.end
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">
<!--#include file="check.asp" -->
<script language="VBScript">
<!--
''=======================================================''
''函數作用:檢測添加城市時的信息是否符合要求
''=======================================================''
function checkaddcity()
if add_city.pov.value="0" then
msgbox"請輸入城市所在省份!"
add_city.pov.focus
elseif add_city.city.value="" then
msgbox"請輸入城市名稱!"
add_city.city.focus
elseif len(add_city.city.value)>4 then
msgbox"城市名太長!(4漢字內)"
add_city.city.focus
elseif Right(add_city.city.value,1)="市" then
msgbox"城市名稱后請不要帶“市”!例如北京,請填寫“北京”,不要填寫“北京市”"
add_city.city.value=Replace(add_city.city.value,"市","")
add_city.city.focus
elseif add_city.quhao.value="" then
msgbox"請城市電話區號!如北京010"
add_city.quhao.focus
elseif len(add_city.quhao.value)>4 then
msgbox"區號太長!(3-4位數字)"
add_city.quhao.focus
elseif getStrLen(add_city.about.value)>140 then
msgbox"請輸入文字介紹?。?0漢字內)"
add_city.about.focus
else
add_city.submit
end if
end function
-->
</script>
</head>
<body leftmargin="0" topmargin="2">
<div align="<%=sitealign%>">
<!--#include file="title.asp" -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760" height="80">
<tr>
<td class=t1 bgcolor="#88CCFF" align="right"> </td>
<td class=t1 bgcolor="#88CCFF" align="right">添加城市 </td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border:1px solid #88ccff; border-collapse: collapse" width="760">
<tr>
<td width="200" bgcolor="#88ccff" valign="top" align="center"><!--#include file="add_left.asp" --></td>
<td width="560" valign="top">
<!--表單開始-->
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" width="560" height="217">
<form method="POST" action="add_city.asp" name="add_city">
<tr>
<td width="80" align="right" height="40" bgcolor="#EBF4FA">所在省份:</td>
<td width="480" height="35" bgcolor="#EBF4FA">
<select size="1" name="pov">
<option selected value="0">---請選擇省份---</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>
</td>
</tr>
<tr>
<td width="80" align="right" height="40">添加城市:</td>
<td width="480" height="35">
<input type="text" name="city" size="17" maxlength="4">(4漢字內)</td>
</tr>
<tr>
<td width="80" align="right" height="40" bgcolor="#EBF4FA">城市區號:</td>
<td width="480" height="35" bgcolor="#EBF4FA">
<input type="text" name="quhao" size="17" maxlength="4">(該地區電話區號,如北京010)</td>
</tr>
<tr>
<td width="80" align="right" height="80">城市簡介:</td>
<td width="480" height="77"> <textarea rows="4" name="about" cols="45">如果你有本頁沒有刊登或者刊登錯誤的本地同志活動場所的最新信息,請告訴我們!</textarea>(70漢字內)</td>
</tr>
<tr>
<td width="80" align="right" height="50" bgcolor="#EBF4FA"></td>
<td width="480" height="35" bgcolor="#EBF4FA">
<input type="button" value=" 提 交 " name="add" onclick="checkaddcity()">
<input type="reset" value=" 重 置 " name="B2"></td>
</tr></form>
</table>
<!--表單結束-->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="760" height="40">
<tr>
<td bgcolor="#88CCFF"> </td>
</tr>
</table>
<!--#include file="copyright.asp" -->
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -