?? add_zx.asp
字號:
<!--#include file="config.asp" -->
<%
city=trim(request.form("city"))
leibie=trim(request.form("leibie"))
name=trim(request.form("name"))
about=trim(request.form("about"))
address=trim(request.form("address"))
bus=trim(request.form("bus"))
site=trim(request.form("site"))
tel=trim(request.form("tel"))
pic1=trim(request.form("pic1"))
pic2=trim(request.form("pic2"))
pic3=trim(request.form("pic3"))
set rs=server.CreateObject("adodb.recordset")
if len(name)>0 then
rs.open"select * from xinxi where 名稱='" &name& "'",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 xinxi",conn,3,3
rs.addnew
rs("名稱")=name
rs("城市")=city
rs("類別")=leibie
rs("介紹")=about
rs("地址")=address
rs("公交")=bus
rs("網站")=site
rs("電話")=tel
rs("圖片1")=pic1
rs("圖片2")=pic2
rs("圖片3")=pic3
rs("審核")=-1 '0未審核,-1已審核
rs("推薦")=0 '0不推薦,-1推薦
rs("日期")=date()
rs.update
rs.close
set rs=nothing
response.redirect "ok.asp?ok=zx"
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">
<script language="VBScript">
<!--
''=======================================================''
''函數作用:檢測添加資訊時的信息是否符合要求
''=======================================================''
function checkaddzx()
if len(add_zx.name.value)=0 then
msgbox"請輸入資訊名稱!(8漢字內)"
add_zx.name.focus
elseif getStrLen(add_zx.name.value)>16 then
msgbox"咨訊名稱請不要超過8個漢字!"
add_zx.name.focus
elseif add_zx.city.value="0" then
msgbox"請選擇所在城市!"
add_zx.city.focus
elseif add_zx.leibie.value="0" then
msgbox"請選擇資訊類別!"
add_zx.leibie.focus
elseif len(add_zx.about.value)=0 then
msgbox"請輸入文字介紹!(240字內)"
add_zx.about.focus
elseif Len(add_zx.about.value)>240 then
msgbox"您的介紹文字太長了,請控制在240個字內!"
add_zx.about.focus
elseif Len(add_zx.address.value)>200 then
msgbox"您輸入的地址太長了,請控制在200個字內!"
add_zx.address.focus
elseif Len(add_zx.bus.value)>200 then
msgbox"您輸入的公交地址太長了,請控制在200個字內!"
add_zx.bus.focus
elseif Len(add_zx.site.value)>150 then
msgbox"您輸入的網址太長了,請控制在150字內!"
add_zx.site.focus
elseif len(add_zx.tel.value)>200 then
msgbox"您輸入的電話信息太長了,請控制在200個字內!"
add_zx.tel.focus
elseif len(add_zx.pic1.value)>200 then
msgbox"您輸入的圖片地址太長了,請控制在200個字符內!"
add_zx.pic1.focus
elseif add_zx.pic2.value<>"http://" and (add_zx.pic1.value="http://" or add_zx.pic1.value="0") then
msgbox"請先填寫圖片1的地址"
add_zx.pic1.focus
elseif len(add_zx.pic2.value)>200 then
msgbox"您輸入的圖片地址太長了,請控制在200個字符內!"
add_zx.pic2.focus
elseif add_zx.pic3.value<>"http://" and (add_zx.pic1.value="http://" or add_zx.pic1.value="0" or add_zx.pic2.value="http://" or add_zx.pic2.value="0") then
msgbox"請先填寫圖片1和圖片2的地址"
add_zx.pic1.focus
elseif len(add_zx.pic3.value)>200 then
msgbox"您輸入的圖片地址太長了,請控制在200個字符內!"
add_zx.pic3.focus
else
add_zx.submit
end if
end function
-->
</script>
</head>
<body leftmargin="0" topmargin="2">
<!--#include file="check.asp" -->
<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="center" width="300"> </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">
<form method="POST" action="add_zx.asp" name="add_zx"> <tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">所在城市:</td>
<td width="480" bgcolor="#EBF4FA">
<select name="city">
<option value='0'>請選擇城市</option>
<%set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from city where 審核=-1 order by 省份,人氣 desc",conn,1,1
while not rs1.eof
response.write"<option value='" &rs1("區號")& "'>" &rs1("城市")& " (" & rs1("區號") & " | " & rs1("省份") &")</option>"
rs1.movenext
wend
rs1.close
set rs1=nothing%>
</select>
</td>
</tr>
<tr>
<td width="80" align="right" height="35">資訊類別:</td>
<td width="480"><select size="1" name="leibie">
<option selected value="0">---請選擇類別---</option>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from leibie order by 類別編號",conn,1,1
while not rs.eof
response.write"<option value='" &rs("類別編號")& "'>" &rs("類別名")& "</option>"
rs.movenext
wend
rs.close
set rs=nothing%>
</select>
</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">名 稱:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="name" size="16" maxlength="16">(8漢字內)
<a href="add_site.asp">如果您添加網站請點這里</a></td>
</tr>
<tr>
<td width="80" align="right" height="35">介 紹:</td>
<td width="480"><textarea rows="6" name="about" cols="45"></textarea>(240字內)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">地 址:</td>
<td width="480" bgcolor="#EBF4FA">
<textarea rows="5" name="address" cols="45"></textarea>(200字內)</td>
</tr>
<tr>
<td width="80" align="right" height="35">公 交:</td>
<td width="480"><textarea rows="5" name="bus" cols="45"></textarea>(200字內)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">網 站:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="site" size="46" value="http://"></td>
</tr>
<tr>
<td width="80" align="right" height="35">電 話:</td>
<td width="480">
<input type="text" name="tel" size="46"></td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">圖 片 1:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="pic1" size="46" value="http://">(圖片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35">圖 片 2:</td>
<td width="480">
<input type="text" name="pic2" size="46" value="http://">(圖片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#EBF4FA">圖 片 3:</td>
<td width="480" bgcolor="#EBF4FA">
<input type="text" name="pic3" size="46" value="http://">(圖片地址)</td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#FFFFFF"> </td>
<td width="480" bgcolor="#FFFFFF">
如果你想推薦你的資訊,請您至少保證填寫2張圖片介紹!然后留言!<br>
<a href="mailto:Email:d1tz@qq.com">Email:d1tz@qq.com</a><br>
Q Q:339542869<font color="#ff0000">(請勿將此號碼公布,歡迎站長、酒吧網吧等負責人添加,保持聯系)</font> </td>
</tr>
<tr>
<td width="80" align="right" height="35" bgcolor="#FFFFFF"> </td>
<td width="480" bgcolor="#FFFFFF">
<input type="button" value=" 提 交 " name="add" onclick="checkaddzx()">
<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 + -