⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hostbuynow.asp

📁 一个非常优秀的自动建站程序
💻 ASP
字号:
<!--#include file="top.asp"-->
<!--#include file="../checkpost.asp"-->
<TABLE WIDTH="100%" BORDER="0" ALIGN="CENTER"><TR><TD>
<table width="100%" align="center" bgcolor="#cccccc" border="0" cellpadding="5" cellspacing="1">
<tr>
<td align=center bgcolor="#FFFFFF">
<%
if Request.form("submit")="正在开通站点,请不要刷新和关闭页面" then
'此模块是进行站点的开通操作
WebID = Request.form("WebID")
if (WebID="") then Response.Redirect ("error.asp?id=001")
set rs=server.createobject("adodb.recordset")
sql="select * from [Host_Ok] where WebID=" & WebID
rs.open sql,conn,1,1
if rs.bof and rs.eof then Response.Redirect("error.asp?id=001")
HostID=rs("HostID")
ServerID=rs("ServerID")
FtpName=rs("FtpName")
HostIP=rs("HostIP")
Price=rs("Price")
rs.close
set rs=server.createobject("adodb.recordset")
sql="select HostID,HostName,HostSize,MailSize,MailNum,WebMaxConnections,WebMaxBandwidth,WebAccessScript from [Host_List] where HostID=" & HostID
rs.open sql,conn,1,1
if rs.bof and rs.eof then
Response.Redirect("error.asp?id=006")
else
HostName=rs("HostName")
HostSize=rs("HostSize")
MailSize=rs("MailSize")
MailNum=rs("MailNum")
WebMaxConnections=rs("WebMaxConnections")
WebMaxBandwidth=rs("WebMaxBandwidth")
WebAccessScript=rs("WebAccessScript")
end if
rs.close
'下面是接口函数,赋值
Set Autohost = Server.CreateObject("autohost.Createhost")
Autohost.Hostip=HostIP
Autohost.HostPort=Port
Autohost.Guid=Guid
Autohost.HostAction="respace"'动作,调整空间大小命令
Autohost.Hostindex = ServerID'站点的INDEX
Autohost.Hostspace = (clng(HostSize))*1024*1024'空间大小
Autohost.HostConnections = clng(WebMaxConnections)'空间连接数
Autohost.HostAccessScript = WebAccessScript'是否脚本还是无
Autohost.HostFooter=0'站点强制广告
ReturnValue=Autohost.send'传递给服务器执行
set Autohost=nothing
'以下是检查服务器的返回值,因为服务器返回值里有控制符,所以这个只对返回值进行查找过滤处理
if instr(ReturnValue,"失败") then 
   Response.Redirect("error.asp?ID=012")
elseif instr(ReturnValue,"BUSING") then 
   Response.Redirect("error.asp?ID=016")
elseif instr(ReturnValue,"CLOSE") then 
   Response.Redirect("error.asp?ID=017")
elseif ReturnValue="" then 
   Response.Redirect("error.asp?ID=012")
elseif instr(ReturnValue,"非法命令") then 
   Response.Redirect("error.asp?ID=019")
elseif instr(ReturnValue,"非法用户") then 
   Response.Redirect("error.asp?ID=020")
elseif instr(ReturnValue,"成功") then 
sql="select * from [BuyLog_List] where (BuyLogID is null)"
rs.open sql,conn,1,3
rs.addnew
rs("UserID")=session("ID")
rs("BuyLogMoney")=nowMoney
rs("BuyLogDate")=now
rs("BuyLogOther")="管理员转正 " & HostName & "(" & HostID & ") 网站空间, " & Request.form("Years") & " 年。"
rs.update
rs.close
sql="select * from [Host_OK] where FtpName='" & FtpName & "'"
rs.open sql,conn,1,3
rs("HostSize")=HostSize
rs("Connections")=WebMaxConnections
rs("Price")=Price
rs("Years")=Request.form("Years")
rs("WebState")=2
rs("BeginDate")=Date()
rs("EndDate")=Date()+(Request.form("Years")*365)+1
rs.update
rs.close
if MailSize>0 and MailNum>0then
set rs2=server.createobject("adodb.recordset")
sql="select * from [Mail_OK] where (MailID is null)"
rs2.open sql,conn,1,3
rs2.addnew
rs2("UserID")=session("ID")
rs2("MailName")="赠送邮箱"
rs2("MailSize")=MailSize
rs2("MailNum")=MailNum
rs2("BeginDate")=Date()
rs2("EndDate")=Date()+(Request.form("Years")*365)+1
rs2("MailMater")=""
rs2("MailType")=0
rs2.update
rs2.close
end if
Response.Redirect("HostList.asp")
else
   Response.Redirect("error.asp?ID="&ReturnValue)
end if
else
WebID = Request("WebID")
if (WebID="") then Response.Redirect ("error.asp?id=001")
set rs=server.createobject("adodb.recordset")
sql="select Price from [Host_Ok] where WebID=" & WebID
rs.open sql,conn,1,1
if rs.bof and rs.eof then Response.Redirect("error.asp?id=001")
%>
<form name="form" method="post" action="HostBuyNow.asp">
<br><br>
<table>
<tr>
 <td>购买年限</td>
 <td><select size="1" name="Years">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>年</td>
</tr></table>
<br>
注意:在交易过程中,因网速问题,可能会花时间长一些,请不要刷新或关闭页面。
<input type="hidden" name="WebID" value="<%=WebID%>">
<br><br>
<input type=submit name="submit" value="确认交易" onClick="this.value='正在开通站点,请不要刷新和关闭页面'" style="font-size: 9pt; COLOR: #ffffff; height:20px;background-color:#568ac2;" onMouseOver ="this.style.backgroundColor='#77A3D2'" onMouseOut ="this.style.backgroundColor='#568ac2'">
</form>
<%
rs.close
'Set rs = Nothing
end if
%>
</td>
</tr>
</table>

</TD></TR></TABLE>
<!--#include file="foot.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -