User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 332,773 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,844 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Apr 5th, 2005
Views: 3,427
I created this code because i was bored and wanted to try something with some code and i ended up creating this little code snip.

Code from: http://www.iportalx.net
Last edited : Jan 2nd, 2007.
asp Syntax
  1. You can display as many banners as you want. Just change the intTotalBanners to how many banners you have and change the saryBanners(3,3) number 3 (in red) to how many banners you have add more saryBanners(1,3) (changing the number in red for each new banner, go up 1 each time).
  2.  
  3. Heres the code, just include it where you want the banner(s) to dispaly:
  4.  
  5. <%
  6. Dim saryBanners(3,3)
  7. Dim intRandomNumber
  8. Dim intTotalBanners
  9.  
  10. intTotalBanners = 3
  11.  
  12. saryBanners(1,1) = "Visit MadDogs-ASP.com!"
  13. saryBanners(1,2) = "http://www.maddogs-asp.com/images/portal-banner.gif"
  14. saryBanners(1,3) = "http://www.maddogs-asp.com/"
  15.  
  16. saryBanners(2,1) = "Visit MadDogs-ASP.com!"
  17. saryBanners(2,2) = "http://www.maddogs-asp.com/forum/uploads/maddog.gif"
  18. saryBanners(2,3) = "http://www.maddogs-asp.com/"
  19.  
  20. saryBanners(3,1) = "Visit MadDogs-ASP.com!"
  21. saryBanners(3,2) = "http://www.maddogs-asp.com/images/maddogs-portal.gif"
  22. saryBanners(3,3) = "http://www.maddogs-asp.com/"
  23.  
  24. randomize
  25. intRandomNumber = Int((intTotalBanners) * Rnd + 1)
  26.  
  27. Response.Write("<a href=""" & saryBanners(intRandomNumber,3) & """ title=""" & saryBanners(intRandomNumber,1) & """ target=""_blank""><img src=""" & saryBanners(intRandomNumber,2) & """ border=""0""></a>")
  28.  
  29. %>
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 9:26 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC