欢迎光临
我们一直在努力

用HTML META标签和ASP来作定时迟时信息

建站超值云服务器,限时71元/月

using asp and html meta tags to make a dynamic delay message

this is a little trick to display a timed message to the user after doing some sort of task. by mixing

some creative asp with a simple html meta refresh you can display a message to a user for a specified

period of time and then redirect them back to wherever you want.

meta tags with an http-equiv attribute are equivalent to http headers. usually, they control the action of

browsers, and may be used to refine the information provided by the actual headers.

here is how it works.

after completing some sort of asp code. ( possibly a database update ).

you can redirect the user like so to the delay page.

first, turn on buffering because youll probably need it depending on where in your page you redirect.

put this at the top of your page before the <html> tag.

<% response.buffer = true %>

then when you are ready to send the user to the delay page do something like this.

<% mymessage = server.urlencode("adding new product….please wait") %>

<% response.redirect ("delay.asp?delay_time=3&delay_message=" & mymessage & "&redirect_url=default.asp") %>

as you see can see there are 3 variables we send to the delay page.

delay_time

redirect_url

delay_message

then the delay.asp page would consist of the following code.

<%@ language="vbscript" %>

<%

delay_time = request("delay_time")

redirect_url = request("redirect_url")

delay_message = request("delay_message")

%>

<html>

<head>

<meta http-equiv="refresh" content="<% =delay_time %>; url=<% =redirect_url %>">

<title>delay</title>

</head>

<body color="#ffffff">

<font face="arial"><p align = "center"><strong><% =delay_message %></strong></p></font>

</body>

</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用HTML META标签和ASP来作定时迟时信息
分享到: 更多 (0)