Hello and welcome to the Webmasters Forums!. This is the best place to get webmasters resources for free. Get $2 for free today, read more - Make your payment today. Download premium and professional templates for free. Get free web hosting without ads, read more. You can get lot more by simply join with this forum. To gain full access to the forums you must sign up for a free account.


Post Reply  Post Thread 

A very rudimentary banner rotator system [ ASP ]

Post Bank
Posting Manager
******

Posts: 995
Group: Forum Team
Joined: Sep 2006
Status: Online
Make money from now. You can make money just for posting on this forum. Every discussions on this community gives you more money. $2 minimum payout. So get your payment today, SignIn with this forum.

Signin to Remove this Post

yupfy45
Newbie


Posts: 7
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Points: 0 (Donate)
Post: #1

Big Grin A very rudimentary banner rotator system [ ASP ]


Our page is "mypage.html" and we are requesting information to complete it from "http://www.myadrotator.com/adrotator.asp" which may be located in the same or in a different site. The information provided by the second file will determinate the ad to be display in our page.

mypage.html

Code:
<html>
<title>My page</title>
<body>

<script language="javascript" src="http://www.myadrotator.com/adrotator.asp"></script>

</body>
</html>



adrotator.asp

Code:
<%
if session("ad")="" then
     session("ad")=0
end if

if session("ad")=5 then
   session("ad")=1
else
    session("ad")=session("ad")+1
end if
%>

<% Select Case session("ad") %>
<% case 1 %>
     document.write ("<A HREF=http://www.1site.com">)
     document.write ("<IMG SCR=1.gif>")
     document.write ("</A>")
<% case 2 %>
     document.write ("<A HREF=http://www.2site.com">)
     document.write ("<IMG SCR=2.gif>")
     document.write ("</A>")
<% case 3 %>
     document.write ("<A HREF=http://www.3site.com">)
     document.write ("<IMG SCR=3.gif>")
     document.write ("</A>")
<% case 4 %>
     document.write ("<A HREF=http://www.4site.com">)
     document.write ("<IMG SCR=4.gif>")
     document.write ("</A>")
<% case 5 %>
     document.write ("<A HREF=http://www.4site.com">)
     document.write ("<IMG SCR=4.gif>")
     document.write ("</A>")
<% End select %>



* Lines 2-3. Each time a new visitor gets to "http://www.myadrotator.com/adrotator.asp" a new session will be open, and by using the session method, we will define session("ad") value to 0. In case the visitor is not new, the value for session("ad") will exits, and that value will be keep.
* Lines 6-10. The value for Session("ad") is increased by one unless that value is 5 (which is the maximum value allowed in this script)
* Lines 13-34. By using Select_case the page will return the information necessary to display the appropiate ad at "mypage.html". The first time a visitor accesses our page the ad display will be the first one, the second time ad number two and so on. After 5 visits, the process will start again. We may easily increase the number of ads just by adding more obtions within Select_case and setting the maximum number from 5 to the new maximum in line 6.

NOTE: when writing the javascript code you must be very carefull: do not include brakets within the brakets in the javascript code
p.e.: Correct: document.write ("<A HREF=http://www.4site.com>")
Incorrect: document.write ("<A HREF="http://www.4site.com"">)
Correct: document.write ("<A HREF='http://www.4site.com'">)
You may include in the response as many lines like the ones above or any other javascript code.

23-09-2006 01:57 AM
Find all posts by this user Quote this message in a reply
bojomojo
Senior Member
****


Posts: 363
Group: Registered
Joined: Sep 2007
Status: Offline
Reputation: 1
Points: 256 (Donate)
Post: #2

RE: A very rudimentary banner rotator system [ ASP ]


well.. instructions on how to make it work will be appreciated Big Grin


Paid to Post webmastering forums, high rates | Fastest free image host.


Tech Blog, latest offers like free domains, hosting and everything
08-09-2007 09:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ivenms
Administrator
*******


Posts: 2,177
Group: Administrators
Joined: Sep 2006
Status: Offline
Reputation: 14
Points: 4389 (Donate)
Post: #3

RE: A very rudimentary banner rotator system [ ASP ]


bojomojo Wrote:
well.. instructions on how to make it work will be appreciated Big Grin


All on there.

Put the java script to your pages.

Edit the link and image source according to your client's banner.


Read: General Rules & Policies before posting.
Make Money By Posting | Earning and Exchanging Points | Add Your Links
08-09-2007 05:36 PM
Find all posts by this user Quote this message in a reply
bojomojo
Senior Member
****


Posts: 363
Group: Registered
Joined: Sep 2007
Status: Offline
Reputation: 1
Points: 256 (Donate)
Post: #4

RE: A very rudimentary banner rotator system [ ASP ]


sorry dumb me, i got fooled by the name.. sorry again


Paid to Post webmastering forums, high rates | Fastest free image host.


Tech Blog, latest offers like free domains, hosting and everything
08-09-2007 06:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  PHP Log-In System: How? addik 15 1,015 23-09-2007 02:57 AM
Last Post: Lord_Daksh

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites
Rate This Thread:

Forum Jump:

Sign In to Remove Ads

Download 1000's of web templates. Unlimited access!
World's Best Web Hosting
Resources

Recommended Sites:



Visit our Sponsors!

Current time: 21-11-2008, 02:17 PM


Copyright © 2002-2008 MyBB Group
Powered By MyBB