零基础建站培训介绍

当前位置:

ASP定时代码,实现网站定时切换

ASP现在很少用了,但在某些ASP程序网站里,还需要设置一些功能。例如设置ASP定时器,通过定时实现网站设置定时切换功能。

ASP做网站

ASP定时代码:


<%
Dim T,T1,T2
T=time()
T1=#08:30:00# '时间的定界符为#,这样才能正确比较
T2=#21:30:00#
%>

<%if T>=T1 and T<=T2 then%> dvnone<%end if%>

代码详解:

  • Dim 定义三个变量;
  • T=time()代表是当前时间;
  • T1=#08:30:00# 代表起始时间
  • T2=#21:30:00# 代表结束时间
  • <%if T>=T1 and T<=T2 then%> 判断当前时间是否在起始与结束时间之内

通过ASP定时代码来实现不同时间切换不同界面


<%
Dim T,T1,T2
T=time()
T1=#08:30:00# '时间的定界符为#,这样才能正确比较
T2=#21:30:00#
%>


<div class="pay-auto<%if T>=T1 and T<=T2 then%> dvnone<%end if%>">

<form name="formpay" id="formpay" action="onlinePayMore.asp" method="post" >
<table class="manager-table s-table">
<tr>
<td height="45" colspan="2" align="left"><span style="float:left;color:#f00;">在线充值</span><span style="float:right;color:#f00;">客服(QQ:2399118408)</span></td>
</tr>
<tr>
<td width="157" height="48" align="left">充值金额:</td>
<td width="631" align="left"><input name="payMoney" class="manager-input s-input input_pri s-width" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" size="10" maxlength="10" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=paymoney%>"">
</td>
</tr>
<tr>
<td height="48">用户名:</td>
<td><input type="text" class=" s-width s-input s-width" name="username" value="<%=session("user_name")%>" /> </td>
</tr>

<tr>
<td height="48">付款方式:</td>
<td>
<div class="Pay_type">
<%if defaultpay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1


if iswestpay then%>
<!--<input type="radio" name="paytype" value="defaultpaywx" <%=checked%> id="pay_defaultpaywx">&nbsp;&nbsp;<label for="pay_defaultpaywx"><img src="../mail/wx_a.png" class="zffs2" alt="默认支付接口" title="微信" /></label>-->
<input type="radio" name="paytype" value="defaultpay" checked="checked" id="pay_defaultpay">&nbsp;&nbsp;<label for="pay_defaultpay"><img src="../mail/zfb_a.png" class="zffs1" alt="z支付接口" title="支付宝" /></label>

<!--
<dl>
<dt><input type="radio" name="paytype" value="defaultpayjd" id="pay_defaultpayjd"><label for="pay_defaultpayjd"><img src="onlineImg/jd.gif" width="96" height="37" alt="京东支付接口" title="京东支付接口" /><span>手续费:<%=returnbfb(defaultpay_fy)%>%</span></label>
</dt>
</dl>
-->
<%end if%>
<%end if%>
<%if tenpay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1

%>
<dl>
<dt><input type="radio" name="paytype" value="tenpay" <%=checked%> id="pay_tenpay"><label for="pay_tenpay"><img src="onlineImg/3.gif" alt="财付通支付" title="财付通支付" /><span>手续费:<%=returnbfb(tenpay_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if yeepay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1

%>
<dl>
<dt><input type="radio" name="paytype" value="yeepay" <%=checked%> id="pay_yeepay"><label for="pay_yeepay"><img src="onlineImg/1.jpg" alt="易宝支付" title="易宝支付" />
<span>手续费:<%=returnbfb(yeepay_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if alipay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="alipay" <%=checked%> id="pay_alipay"><label for="pay_alipay"><img src="onlineImg/2.gif" width="96" height="37" alt="支付宝支付" title="支付宝支付" /><span>手续费:<%=returnbfb(alipay_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if kuaiqian then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="kuaiqian" <%=checked%> id="pay_kuaiqian"><label for="pay_kuaiqian"><img src="onlineImg/4.jpg" title="快钱支付v1.0" alt="快钱支付v1.0"/><span>手续费:<%=returnbfb(kuaiqian_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if kuaiqian2 then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="kuaiqian2" <%=checked%> id="pay_kuaiqian2"><label for="pay_kuaiqian2"><img src="onlineImg/4.jpg" alt="快钱支付v2.0" title="快钱支付v2.0" /><span>手续费:<%=returnbfb(kuaiqian2_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if cncard then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="cncard" <%=checked%> id="pay_cncard"><label for="pay_cncard"><img src="onlineImg/5.jpg" title="云网支付" alt="云网支付" />
<span>手续费:<%=returnbfb(cncard_fy)%>%</span></label>
</dt>
</dl>
<%end if%>
<%if chinabank then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="chinabank" <%=checked%> id="pay_chinabank"><label for="pay_chinabank"><img src="onlineImg/6.jpg" alt="网银在线支付" title="网银在线支付" /><span>手续费:<%=returnbfb(chinabank_fy)%>%</span></label></dt>
</dl>
<%end if%>

<%if shengpay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="shengpay" <%=checked%> id="pay_shengpay"><label for="pay_shengpay"><img src="onlineImg/7.jpg" alt="盛付通支付" title="盛付通支付" /><span>手续费:<%=returnbfb(shengpay_fy)%>%</span></label></dt>
</dl>
<%end if%>

<%if wxpay then
checked=""
if cur=0 then checked=" checked "
cur=cur+1
%>
<dl>
<dt><input type="radio" name="paytype" value="wxpay" <%=checked%> id="pay_wxpay"><label for="pay_wxpay"><img src="onlineImg/weixin.png" alt="微信支付" title="微信支付" /><span>手续费:<%=returnbfb(wxpay_fy)%>%</span></label></dt>
</dl>
<%end if%>
</div>
</td>

</tr>
<tr>
<td height="48" colspan="2" align="center"><input type="submit" value="继续下一步" class="manager-btn s-btn mb_sub btnjs"></td>
</tr>

</table>

</form>

</div>

<div class="pay-shoudong<%if T<T1 or T>T2 then%> dvnone<%end if%>">

<form name="form1" method="post" action="http://gl.xuewangzhan.net/manager/mail/mail.asp">

<table class="manager-table s-table">


<tr>
<td colspan="2" style="color:#f00;font-size:16px;">在线充值<span style="float:right;font-size:14px">客服(QQ:2399118408)<a href="http://wpa.qq.com/msgrd?v=3&amp;uin=2399118408&amp;site=qq&amp;menu=yes" target="_blank"><img src="onlineImg/pa.png" alt="建站咨询" /></a></span></td>
</tr>

<tr>
<td>充值金额:</td>
<td>

<input name="payMoney" class="manager-input s-input input_pri s-width" type="text" onkeyup="this.value=this.value.replace(/\D/g,'')" size="10" maxlength="10" onafterpaste="this.value=this.value.replace(/\D/g,'')" value="<%=paymoney%>"">&nbsp;&nbsp;</td>
</tr>

<tr>
<td>用户名:</td>
<td><input type="text" class=" s-width s-input" name="username" value="<%=session("user_name")%>" /> </td>
</tr>

<tr>
<td>付款方式:</td>
<td><input id="zfb" type="radio" name="zhifu" value="支付宝" checked="checked" /><img class="zffs1" src="../mail/zfb_a.png" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="wx" type="radio" name="zhifu" value="微信"/><img class="zffs2" src="../mail/wx_a.png" /></td>
</tr>


<tr>
<td colspan="2" style="text-align:center;"><input id="btnSubmit" class="mb_sub btnjs" type="button" value="点此在线充值" /></td>
</tr>

ASP定时代码在自己做网站时可以直接拿去使用,可以轻松实现定时切换功能。

上一课: 下一课:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

相关教程

  • ASP现在很少用了,但在某些ASP程序网站里,还需要设置一些功能。例如设置ASP定时器,通过定时实现网站设置定时切换功能。ASP定时代码:[c