?? xinxi_edit.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file=cookies.asp-->
<!--#include file=../config.asp-->
<%
if request("cnmai")="edit" then
function chkcnmai(char)
if instr(char,"'") then
response.write "錯誤字符!"
response.end
end if
if instr(char,"|") then
response.write "錯誤字符!"
response.end
end if
if instr(char,"<") then
response.write "錯誤字符!"
response.end
end if
if instr(char,">") then
response.write "錯誤字符!"
response.end
end if
if instr(char,"&") then
response.write "錯誤字符!"
response.end
end if
if instr(char,"%") then
response.write "錯誤字符!"
response.end
end if
if instr(char,";") then
response.write "錯誤字符!"
response.end
end if
if instr(char,"$") then
response.write "錯誤字符!"
response.end
end if
end function
username=request.cookies("cnmai")("username")
class1=trim(request("class1"))
class2=trim(request("class2"))
biaoti=trim(request("biaoti"))
memo=trim(request("memo"))
name=trim(request("name"))
if class1="0" or class1="" then
response.write"<SCRIPT language=JavaScript>alert('請正確選擇一級分類');javascript:history.go(-1)</SCRIPT>"
response.end
end if
if class2="0" or class2="" then
response.write"<SCRIPT language=JavaScript>alert('請正確選擇二級分類');javascript:history.go(-1)</SCRIPT>"
response.end
end if
if biaoti="" then
response.write"<SCRIPT language=JavaScript>alert('標題不為空');javascript:history.go(-1)</SCRIPT>"
response.end
end if
chkcnmai(biaoti)
if len(biaoti)>40 then
response.write"<SCRIPT language=JavaScript>alert('標題字數不超過40');javascript:history.go(-1)</SCRIPT>"
response.end
end if
if memo="" then
response.write"<SCRIPT language=JavaScript>alert('信息內容不為空');javascript:history.go(-1)</SCRIPT>"
response.end
end if
if trim(request("name"))="" then
response.write"<SCRIPT language=JavaScript>alert('聯系人不能為空');javascript:history.go(-1)</SCRIPT>"
response.end
end if
id=trim(request("id"))
set rs=server.createobject("adodb.recordset")
sql = "select * from xinxi where id="&cstr(id)
rs.open sql,conn,1,3
if rs.eof then
errcnmai(0)
response.end
end if
rs("class1")=class1
rs("class2")=class2
rs("biaoti")=biaoti
rs("leixing")=request("leixing")
rs("diqu")=trim(request("diqu"))
rs("memo")=memo
rs("tupian")=request("tupian")
rs("name")=name
rs("com")=request("com")
rs("email")=trim(request("email"))
rs("qq")=trim(request("qq"))
rs("dianhua")=trim(request("dianhua"))
rs("dizhi")=trim(request("dizhi"))
rs("yz")=request("d")
rs("tuijian")=request("tui")
rs.update
rs.close
set rs=nothing
closedb
response.write "<p align=""center"">修改<font color=ff0000>"&biaoti&"</font>成功!</p>"
response.write "<meta http-equiv=refresh content=""1;URL=xinxi.asp"">"
else
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息修改</title>
<link href="inc_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center">
<img src="img/list_bo.gif">
</p>
<div align="center">
<center>
<form action="xinxi_edit.asp?cnmai=edit" name="myform" method="POST">
<tr>
<td width="456">
<table width="513" border="0" cellspacing="0" cellpadding="0" height="126" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td height="25" bgcolor="#FEEEBC" colspan="2" style="border: 1px solid #CCCCCC" align="center" >
<p><b>修改信息</b></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
信息類別:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<%
dim rs
dim sql,i
dim count,username
dim id,class1,class2,biaoti,leixing,jiage,diqu,memo,name,email,dianhua,qq,tupian,com,yz,tuijian,dizhi
id=trim(request("id"))
set rs=server.createobject("adodb.recordset")
sql = "select * from xinxi where id="&cstr(id)
rs.open sql,conn,1,1
if rs.eof then
response.write "參數錯誤!"
response.end
end if
username=rs("username")
class1=rs("class1")
class2=rs("class2")
biaoti=rs("biaoti")
leixing=rs("leixing")
diqu=rs("diqu")
memo=rs("memo")
name=rs("name")
com=rs("com")
email=rs("email")
qq=rs("qq")
dianhua=rs("dianhua")
dizhi=rs("dizhi")
tupian=rs("tupian")
yz=rs("yz")
tuijian=rs("tuijian")
rs.close
sql = "select * from class2 order by paixu desc"
rs.open sql,conn,1,1
%><SCRIPT language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("class2"))%>","<%= trim(rs("class1"))%>","<%= trim(rs("id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.class2.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.class2.options[document.myform.class2.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT>
<%
sql = "select * from class1 order by paixu desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "請先添加分類。"
response.end
else
%>
<SELECT name="class1" onChange="changelocation(document.myform.class1.options[document.myform.class1.selectedIndex].value)" size="1">
<OPTION value="0">==分類==</OPTION>
<%do while not rs.eof%>
<OPTION <%if trim(class1)=cstr(rs("id")) then%>selected<%end if%> value="<%=trim(rs("id"))%>"><%=trim(rs("class1"))%></OPTION>
<%
rs.movenext
loop
end if
rs.close
%>
</SELECT>
<SELECT name="class2">
<%
sql = "select id,class2 from class2 where id="&cstr(class2)
rs.open sql,conn,1,1
%>
<OPTION <%if trim(class2)=cstr(rs("id")) then%>selected<%end if%> value="<%=trim(rs("id"))%>"><%=trim(rs("class2"))%></OPTION>
<%rs.close%>
</SELECT><input type="hidden" name="id" size="7" maxlength="6" value="<%=id%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
信息標題:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" maxlength="40" name="biaoti" size="47" value="<%=biaoti%>">(<font color="#CC5200">40字以內</font>)</td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
交易類型:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<select name="leixing">
<option value="1"><%=leixing1%></option>
<option value="2"><%=leixing2%></option>
<option value="3"><%=leixing3%></option>
<option value="4"><%=leixing4%></option>
<option value="5"><%=leixing5%></option>
<option value="6"><%=leixing6%></option>
<option value="7"><%=leixing7%></option>
<option value="8"><%=leixing8%></option>
<option value="9"><%=leixing9%></option>
</select></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
交易地區:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="diqu" size="21" maxlength="10" value="<%=diqu%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
<p>信息說明:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<textarea rows="11" name="memo" cols="62"><%=memo%></textarea></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
聯系人:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="name" size="23" maxlength="15" value="<%=name%>">
<input type="text" name="com" size="23" maxlength="15" value="<%=com%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
email:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="email" size="23" maxlength="40" value="<%=email%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
QQ:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="qq" size="23" maxlength="40" value="<%=qq%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
聯系電話:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="dianhua" size="23" maxlength="40" value="<%=dianhua%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
圖片地址:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="tupian" size="41" value="<%=tupian%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
聯系地址:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="text" name="dizhi" size="41" maxlength="40" value="<%=dizhi%>"></td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
審核驗證:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="radio" value="1" name="d" <%if yz=1 then%>checked<%end if%> >通過</font><input type="radio" value="11" name="d" <%if yz=0 then%>checked<%end if%> >未通過</td>
</tr>
<tr>
<td height="25" width="103" align="right" style="border-left-style: solid; border-left-width: 1" bordercolor="#999999" >
推薦:</td>
<td height="25" width="410" style="border-right-style: solid; border-right-width: 1" bordercolor="#999999" >
<input type="radio" value="1" name="tui" <%if tuijian=1 then%>checked<%end if%>>推薦
<input type="radio" name="tui" value="0" <%if tuijian=0 then%>checked<%end if%>>未推薦</td>
</tr>
<tr>
<td height="25" colspan="2" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bordercolor="#999999">
<p align="center">
<input type="submit" value=" 提交修改 " name="B1"></td>
</tr>
</table>
</td>
</tr>
</form>
</center>
</div>
</body>
</html>
<%
closedb
end if
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -