📄 useradd.asp
字号:
<!--#include file="usertop.asp"-->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr> <!--#include file="left.asp"-->
<TD vAlign=top width=2 bgColor=#FFcc66></td>
<td bgcolor="#FFFFFF" valign="top">
<%
if request.Form("method") = 1 then
if Request("Classid") = "" or Request("Nclassid") = "" then
Errmsg = "<li>请选择二手所属的大栏目及小栏目。"
FoundErr = true
else
Classid = Request("Classid")
Nclassid = Request("Nclassid")
end if
if Trim(Request.Form("title")) = "" then
Errmsg = Errmsg + "<li>请输入二手标题。"
FoundErr = true
else
title = Qcdn.checkStr(Trim(Request.Form("title")))
end if
if Trim(Request.Form("u_id")) = "" then
u_id = 0
else
u_id = Request.Form("u_id")
end if
if Trim(Request.Form("author")) = "" then
author = "匿名"
else
author = Qcdn.checkStr(Trim(Request.Form("author")))
end if
if Trim(Request("content")) = "" then
Errmsg = Errmsg + "<li>请输入二手内容。"
FoundErr = true
else
Content = Qcdn.checkStr(Trim(Request("content")))
end if
if Trim(Request.form("DefaultPic")) <> "" then
pic = 1
DefaultPic = Trim(Request.form("DefaultPic"))
else
pic = Request.Form("pic")
DefaultPic = Trim(Request.form("DefaultPic"))
end if
if FoundErr then
Call Qcdn.Err_List(Errmsg,1)
Response.End()
end if
lx = Request.Form("lx")
dq = Request.Form("dq")
jx = Request.Form("jx")
email_rs= Request.Form("email_rs")
name_rs= Request.Form("name_rs")
tel_rs= Request.Form("tel_rs")
'title,u_id,author,Nclassid,classid,lx,dq,jx,content,email_rs,name_rs,tel_rs
'"&title&"',"&u_id&",'"&author&"',"&Nclassid&","&classid&","&lx&","&dq&","&jx&",'"&content&"','"&email_rs&"','"&name_rs&"','"&tel_rs&"'
'
'
Sql = "Insert into 2s_list(title,DefaultPic,u_id,author,Nclassid,classid,lx,dq,jx,content,email_rs,name_rs,tel_rs)values('"&title&"','"& DefaultPic &"',"&u_id&",'"&author&"',"&Nclassid&","&classid&","&lx&",'"&dq&"',"&jx&",'"&content&"','"&email_rs&"','"&name_rs&"','"&tel_rs&"')"
Conn.execute(Sql)
Response.Write("<script>alert(""添加成功"");location.href=""useradd.asp"";</script>")
Response.End()
end if
sql = "select * from 2s_class where flag <>0 order by Unid asc"
set rs = conn.execute(sql)
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%=Qcdn.HTMLcode(rs(1))%>","<%=rs(2)%>","<%=rs(0)%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.Nclassid.options[document.form1.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<div align="center">
<table width="95%" border="0" cellspacing="1" cellpadding="3" bgcolor="#FFCC66">
<form action="" name="form1" method="post" onSubmit="return check()">
<tr>
<td colspan="2" align="center" height="30" bgcolor="#FFFFFF"><b>发布信息
</b> </td>
</tr>
<tr valign="middle">
<td width="15%" height="25" bgcolor="#FFFFFF">信息类别:</td>
<td width="85%" height="25" bgcolor="#FFFFFF"> <%
sql = "select Unid,classname from 2s_class where flag = 0 order by Unid asc"
set rs = conn.execute(sql)
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%> <select name="classid" onChange="changelocation(document.form1.classid.options[document.form1.classid.selectedIndex].value)" size="1">
<option value="">选择栏目</option>
<%do while not rs.eof%>
<option value="<%=rs(0)%>"><%=Qcdn.HTMLcode(rs(1))%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select> <select name="Nclassid">
<option value="">选择栏目</option>
</select> <font color="red">*</font></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> 信息标题:</td>
<td height="25" bgcolor="#FFFFFF"> <input name="title" type="text" id="title" size="47" maxlength="40" class=input2>
(<font color="#CC5200">40字以内</font>)</td>
</tr>
<tr valign="middle">
<td height="25" bgcolor="#FFFFFF">上传图片:</td>
<td height="25" bgcolor="#FFFFFF">
<iframe name="ad" src="upload.asp" width="358" height="25" frameborder=0 scrolling=no></iframe>
</td>
</tr>
<tr valign="middle">
<td height="25" bgcolor="#FFFFFF">默认图片:</td>
<td height="25" bgcolor="#FFFFFF"> <input type="text" name="DefaultPic" size="65" class=input2 > </td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> 二手类型:</td>
<td height="25" bgcolor="#FFFFFF"> <select name="lx" id="lx">
<option value="1">出售</option>
<option value="2">求购</option>
<option value="3">出租</option>
<option value="4">求租</option>
<option value="5">求职</option>
<option value="6">招聘</option>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">交易状态:</td>
<td height="25" bgcolor="#FFFFFF"> <select name="jx" id="jx">
<option value="0">没有完成交易</option>
<option value="1">完成交易</option>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> 所在地点:</td>
<td height="25" bgcolor="#FFFFFF"> <select name="dq" id="dq">
<option value="校内">校内</option>
<option value="校外">校外</option>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">描述说明:</td>
<td height="25" bgcolor="#FFFFFF"> <textarea name="content" cols="53" rows="11" id="content"></textarea></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> 联系人:</td>
<td height="25" bgcolor="#FFFFFF"> <input name="name_rs" type="text" id="name_rs" size="23" maxlength="15" class=input2></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> email:</td>
<td height="25" bgcolor="#FFFFFF"> <input name="email_rs" type="text" id="email_rs" size="23" maxlength="40" class=input2>
</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"> 联系方式:</td>
<td height="25" bgcolor="#FFFFFF"> <textarea name="tel_rs" cols="53" rows="2" id="tel_rs"></textarea></td>
</tr>
<tr>
<td height="25" colspan="2" align="center" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value=" 提 交 " class="input2">
<input name="u_id" type="hidden" id="u_id" value="<%= session("user_id") %>">
<input name="author" type="hidden" id="author" value="<%= session("user_name") %>">
<input type="hidden" name="method" value="1"> <input type="reset" name="Submit2" value=" 重 置 " class="input2">
</td>
</tr>
</form>
</table>
</div>
<script language="javascript">
function check(){
if (form1.classid.value =="" || form1.Nclassid.value==""){
alert("请选择栏目");
return false;
}
if (form1.title.value ==""){
alert("请输入标题");
form1.title.focus();
return false;
}
if (form1.content.value ==""){
alert("请输入内容");
form1.content.focus();
return false;
}
if (form1.name_rs.value ==""){
alert("请输入相关联系人");
form1.name_rs.focus();
return false;
}
if (form1.tel_rs.value ==""){
alert("请输入相关联系方式");
form1.tel_rs.focus();
return false;
}
return true;
}
</script>
</td>
</tr>
</table>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -