查看: 4018|回复: 4

[问与答] 求大神来帮忙解决这个批量写入批量发布信息的问题

[复制链接]
六酷网 发表于 2016-2-12 13:16:48 | 显示全部楼层 |阅读模式
代码如下

<!--#include file="livensdb.asp"-->
<!--#include file="../livensconn/livensst.asp"-->
<!--#include file="check.asp"-->
<%id=request("id")
typeid=request("typeid")
action=request("action")
R_domainame=trim(request("domainame"))
R_zcsj=request("zcsj")
R_dqsj=request("dqsj")
R_houzhui=request("houzhui")
R_ispic=request("ispic")
R_istj=request("istj")
R_yisi=trim(request("yisi"))
R_cs=trim(request("cs"))
R_detailyisi=trim(request("detailyisi"))
R_status=request("status")
R_ykj=trim(request("ykj"))
R_cb=trim(request("cb"))
R_xf=trim(request("xf"))
R_saledate=request("saledate")
R_salejia=trim(request("salejia"))
R_adddate=trim(request("adddate"))
R_pid=request("pid")
R_qitajia=trim(request("qitajia"))
R_hits=trim(request("hits"))

SELECT CASE action
CASE "add"
if R_domainame="" then

Response.Write("<script>alert('Pls input the domain!');location.replace('"&request.servervariables("http_referer")&"');</script>")
 楼主| 六酷网 发表于 2016-2-12 13:17:54 | 显示全部楼层
Response.end
end if

  set rsRepeat = conn.execute("select domainame from midb where domainame='"&R_domainame&"'")

  if not (rsRepeat.bof and rsRepeat.eof) then

response.write "<script language='javascript'>alert('" &R_domainame& " is exsited!');location.replace('"&request.servervariables("http_referer")&"');</script>"

response.End

  End If

  rsRepeat.close

  set rsRepeat=Nothing

    set rs=server.createobject("adodb.recordset")

rs.open "select * from midb",conn,3,2

rs.addnew

        rs("houzhui")=R_houzhui

rs("domainame")=R_domainame

rs("ispic")=R_ispic

rs("istj")=R_istj

rs("typeid")=typeid
        rs("zcsj")=R_zcsj
        rs("dqsj")=R_dqsj
        rs("yisi")=R_yisi
        rs("cs")=R_cs
        rs("detailyisi")=R_detailyisi
        if R_status<>"" then
        rs("status")=R_status
        end if
        rs("ykj")=R_ykj
        rs("cb")=R_cb
        rs("xf")=R_xf
        rs("saledate")=R_saledate
        if R_salejia<>"" then
        rs("salejia")=R_salejia
        end if
        rs("adddate")=R_adddate
        rs("pid")=R_pid
        rs("qitajia")=R_qitajia
        rs("hits")=R_hits

rs.update

rs.close

set rs=nothing

Response.Write("<script>alert('Add OK!');window.location='milist.asp';</script>")

Response.end

CASE "edit"

    set rs=server.CreateObject("adodb.recordset")

sql="select * from midb where id="&id

rs.open sql,conn,1,3
        rs("houzhui")=R_houzhui

rs("domainame")=R_domainame

rs("ispic")=R_ispic

rs("istj")=R_istj

rs("typeid")=typeid
        rs("zcsj")=R_zcsj
        rs("dqsj")=R_dqsj
        rs("yisi")=R_yisi
        rs("cs")=R_cs
        rs("detailyisi")=R_detailyisi
        rs("status")=R_status
        rs("ykj")=R_ykj
        rs("cb")=R_cb
        rs("xf")=R_xf
        rs("saledate")=R_saledate
        rs("salejia")=R_salejia
        rs("adddate")=R_adddate
        rs("pid")=R_pid
        rs("qitajia")=R_qitajia
        rs("hits")=R_hits

rs.update

rs.close

set rs=nothing

Response.Write("<script>alert('Modify Sucessfully!');window.location='mi.asp?id="&id&"&typeid="&typeid&"';</script>")

Response.end

CASE "sale"
    set rs=server.CreateObject("adodb.recordset")

sql="select * from midb where id="&id

rs.open sql,conn,1,3

rs("salejia")=rs("ykj")

rs("ykj")=0
        rs("saledate")=date()

rs.update

rs.close

set rs=nothing

Response.Write("<script>alert('sell Sucessfully!');window.location='mi.asp?id="&id&"';</script>")
 楼主| 六酷网 发表于 2016-2-12 13:18:07 | 显示全部楼层
Response.end


CASE "del"

sql="delete from midb where id=" &id
        set rs=conn.execute(sql)

Response.Write("<script>alert('Del OK!');window.location='milist.asp';</script>")

Response.end

END SELECT

if id<>"" then
action="edit"
tit="Manage"
set rs=server.CreateObject("adodb.recordset")
sql="select * from midb where id="&id
rs.open sql,conn,1,1
houzhui=rs("houzhui")
domainame=rs("domainame")
ispic=rs("ispic")
istj=rs("istj")
typeid=rs("typeid")
zcsj=rs("zcsj")
dqsj=rs("dqsj")
yisi=rs("yisi")
cs=rs("cs")
detailyisi=rs("detailyisi")
status=rs("status")
ykj=rs("ykj")
cb=rs("cb")
xf=rs("xf")
saledate=rs("saledate")
salejia=rs("salejia")
adddate=rs("adddate")
pid=rs("pid")
qitajia=rs("qitajia")
hits=rs("hits")
rs.close
set rs=nothing
else
action="add"
tit="Add"
end if%>
<html><head><title><%=webname%> 新米入仓</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="images/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../ueditor/themes/default/ueditor.css"/>
<script type="text/javascript" charset="utf-8" src="ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor/editor_all.js"></script>
</head>
<body><table width="98%"  border="0" cellpadding="6" cellspacing="1" bgcolor="#0A246A" align="center">
<form name="myform" method="POST" action="mi.asp?action=<%=action%>"><input name="id" type="hidden" value="<%=id%>">
<tr align="center" bgcolor="#BBDAFF"><td height="25" colspan="4"><b>域名信息</b></td></tr>
<tr bgcolor="#FFFFCE"><td align="center"><b>域名:</b></td><td><input type="text" name="domainame" size="20" value="<%=domainame%>">
<select name="pid">
<option value="">=请选择=</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from p order by pid asc"
rs.open sql,conn,1,1
do while not rs.eof%>
<option value="<%=rs("pid")%>" <%if pid-rs("pid")=0 then%>selected<%end if%>><%=rs("pname")%></option>
<% rs.movenext
loop
rs.close
set rs=nothing%></select> </td>
<td align="center"><b>一口价:</b></td>
<td><input type="text" name="ykj" size="5" value="<%=ykj%>">元</td></tr>
<tr bgcolor="#F5FAFE"><td width="25%" align="center"><b>域名分类:</b></td>
<td><select name="typeid">
<option value="">=请选择=</option>
<%set rs=server.createobject("adodb.recordset")
sql="select * from mitype where sortid<>0"
rs.open sql,conn,1,1
do while not rs.eof%>
<option value="<%=rs("typeid")%>" <%if typeid-rs("typeid")=0 then%>selected<%end if%>><%=rs("typename")%></option>
<% rs.movenext
loop
rs.close
set rs=nothing%></select>
<select name="houzhui">
<option value="">=请选择=</option>
<option value="0" <%if houzhui="0" then%>selected<%end if%>>.CN</option>
<option value="1" <%if houzhui="1" then%>selected<%end if%>>.COM</option>
<option value="2" <%if houzhui="2" then%>selected<%end if%>>.NET</option>
<option value="3" <%if houzhui="3" then%>selected<%end if%>>.COM.CN</option>
<option value="4" <%if houzhui="4" then%>selected<%end if%>>.ORG</option>
<option value="5" <%if houzhui="5" then%>selected<%end if%>>.CC</option>
<option value="6" <%if houzhui="5" then%>selected<%end if%>>.ME</option>
<option value="7" <%if houzhui="5" then%>selected<%end if%>>.XYZ</option>
<option value="8" <%if houzhui="5" then%>selected<%end if%>>.WANG</option>
<option value="9" <%if houzhui="4" then%>selected<%end if%>>.Co</option>
<option value="10" <%if houzhui="5" then%>selected<%end if%>>.Pw</option>
<option value="11" <%if houzhui="5" then%>selected<%end if%>>.Top</option>
<option value="12" <%if houzhui="5" then%>selected<%end if%>>.LoL</option>
<option value="13" <%if houzhui="5" then%>selected<%end if%>>.GG</option>
</select></td>
<td align="center"><b>域名状态:</b></td><td><select name="status">
<option value="0" <%if status="0" then%>selected<%end if%>>销售中</option>
<option value="1" <%if status="1" then%>selected<%end if%>>已售完</option>
</select></td></tr>
<tr bgcolor="#FFFFFF">
<td align="center"><b>注册日期</b></td><td><input type="text" name="zcsj" size="10" value="<%=zcsj%>"></td>
<td align="center"><b>到期日期</b></td><td><input type="text" name="dqsj" size="10" value="<%=dqsj%>"></td>
</tr>
<tr bgcolor="#F5FAFE">
<td align="center"><b>买入价格</b></td><td><input type="text" name="cb" size="5" value="<%=cb%>">元</td>
<td align="center"><b>买入日期</b></td><td><input type="text" name="adddate" size="10" value="<%=adddate%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><b>卖出价格</b></td><td><input type="text" name="salejia" size="5" value="<%=salejia%>">元</td>
<td align="center"><b>卖出日期</b></td><td><input type="text" name="saledate" size="10" value="<%=saledate%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><b>续费费用</b></td><td><input type="text" name="xf" size="5" value="<%=xf%>">元</td>
<td align="center"><b>其他费用</b></td><td><input type="text" name="qitajia" size="5" value="<%=qitajia%>">元</td>
</tr>
<tr bgcolor="#F5FAFE"><td align="center"><b>简单含义:</b></td>
<td colspan="3"><textarea name="yisi" cols="98" rows="2"  id="description"><%=yisi%></textarea></td></tr>
<tr bgcolor="#F5FAFE"><td align="center"><b>出售链接:</b></td>
<td colspan="3"><textarea name="cs" cols="98" rows="2"  id="description"><%=cs%></textarea></td></tr>

<TR bgcolor="#F5FAFE"><td align="center"><b>是否推荐:</b></td>
<td colspan=3><input type="radio" name="istj" value="1" <%if istj=1 then%>checked<%end if%>>推荐<input name="istj" type="radio" value="0" <%if istj=0 then%>checked<%end if%>>不推荐</td></tr>
<TR bgcolor="#ffffff"><td width="25%" align="center"><b>详细说明:</b><br><br><a href="/mi.asp?id=<%=id%>" target="_blank"><font color=red>预览效果</font></a></td><td colspan="3">            <script type="text/plain" id="myEditor1" name="detailyisi"><%=detailyisi%></script>
            <script type="text/javascript">
            var editor = new baidu.editor.ui.Editor();
            editor.render("myEditor1");
            </script></td></TR>

<%if id<>"" then%>
<TR bgcolor="#ffffff"><td width="25%" align="center"><b>浏览量:</b></td><td colspan="3"><input name="hits" value="<%=hits%>" size=4></td></tr>
<%end if%>
<tr align="center" bgcolor="#F5FAFE"><td colspan="4"><input type="submit" name="Submit" value="确定提交"></td></tr><tr><td height="25" bgcolor="#D4E5F9" colspan="4"></td></tr></form></table>
</body></html>
 楼主| 六酷网 发表于 2016-2-12 13:18:53 | 显示全部楼层
想让大神帮忙看下,如何才可以实现批量发布信息的功能
xuanxiao 发表于 2016-2-15 00:35:32 | 显示全部楼层
回复 4# 六酷网


   把整个程序打包发邮箱support@ttasp.com,需要调试才行
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号