|
Free printable Sudoku Puzzles | Custom Word Search Puzzles | iptocountry.info | Free web storage |
| Free Simple Ad Rotator (.asp) |
With this script we will be able to show to our visitors different
ads each time they access a page from our server. The system is based in
three different pages:
|
| global.asa | |
| <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Sub Application_OnEnd
Sub Session_OnStart
Sub Session_OnEnd
</SCRIPT> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
| Each time a new visitor gets to our pages (when a session starts),
a value for session("ad") will be assigned (line 1o).
The second file ("adrotator.asp") will be used to add the code from different links to our pages. This file will look like this one: |
| adrotator.asp |
| <%
if session("ad")=10 then session("ad")=1 else session("ad")=session("ad")+1 end if %> <% Select Case session("ad") %>
|
In the script above there are some elements we must change.
Option 1
|
| index.asp |
| <html>
<head> <title>My page</title> </head> <body bgcolor=FFFFFF> <center> <!--#include virtual="/adrotator.asp" --> <p>This text is very interesting. </center>
|
Option 2
|
| index.asp |
| <html>
<head> <title>My page</title> </head> <body bgcolor=FFFFFF> <center> <%
<% Select Case session("ad") %>
<p>This text is very interesting. </center>
|
2008@ AspTutorial.info. All rights reserved.