PDA

View Full Version : Need A BIt OF Help With An ASP Script



Vance
01 May 2009, 09:25 PM
I am trying to get a simple banner management script to work, but I have never delt with ASP before so I have no clue what to do to get this to work.

The script is:

%>
<%
ShowBanner Request.QueryString ("type")

function ShowBanner (ptype)
Set theShowBanner = new aShowBanner
theShowBanner.main ptype
end function

class aShowBanner

private o468x60BannerPath
private o468x60BannerCount
private o468x60BannerBegin
private o468x60BannerEnd

private o120x60BannerPath
private o120x60BannerCount
private o120x60BannerBegin
private o120x60BannerEnd

private o100x100BannerPath
private o100x100BannerCount
private o100x100BannerBegin
private o100x100BannerEnd

private o88x31BannerPath
private o88x31BannerCount
private o88x31BannerBegin
private o88x31BannerEnd

private sub Class_Initialize ()

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ START Configuration Settings


o468x60BannerPath = "pgh.creativevp.com/banners/" 'path to 468x60 banners location
o468x60BannerCount = 2 ' Number of banners change it to number on how many banners you have
o468x60BannerBegin = "banner_" ' name for your banners
o468x60BannerEnd = ".gif" 'Extention

o120x60BannerPath = "/vtads/banners/" 'path to 120x60 banners location
o120x60BannerCount = 3 ' Number of banners change it to number on how many banners you have
o120x60BannerBegin = "120x60_" ' name for your banners
o120x60BannerEnd = ".gif" 'Extention

o100x100BannerPath = "/vtads/banners/" 'path to 100x100 banners location
o100x100BannerCount = 3 ' Number of banners change it to number on how many banners you have
o100x100BannerBegin = "100x100_" ' name for your banners
o100x100BannerEnd = ".gif" 'Extention

o88x31BannerPath = "/vtads/banners/" 'path to 100x100 banners location
o88x31BannerCount = 3 ' Number of banners change it to number on how many banners you have
o88x31BannerBegin = "88x31_" ' name for your banners
o88x31BannerEnd = ".gif" 'Extention

'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ END Configuration Settings
end sub

public sub main (ptype)
randomize

if ptype = "468x60" then
lCurBannerPath = o468x60BannerPath
lCurBannerCount = o468x60BannerCount
lCurBannerBegin = o468x60BannerBegin
lCurBannerEnd = o468x60BannerEnd
elseif ptype = "120x60" then
lCurBannerPath = o120x60BannerPath
lCurBannerCount = o120x60BannerCount
lCurBannerBegin = o120x60BannerBegin
lCurBannerEnd = o120x60BannerEnd
elseif ptype = "100x100" then
lCurBannerPath = o100x100BannerPath
lCurBannerCount = o100x100BannerCount
lCurBannerBegin = o100x100BannerBegin
lCurBannerEnd = o100x100BannerEnd
elseif ptype = "88x31" then
lCurBannerPath = o88x31BannerPath
lCurBannerCount = o88x31BannerCount
lCurBannerBegin = o88x31BannerBegin
lCurBannerEnd = o88x31BannerEnd
end if

if lCUrBannerCount <> 0 then
lCurBannerID = CStr (int (rnd * lCurBannerCount) + 1)
if len (lCurBannerID) = 1 then
lCurBannerID = "0" & lCurBannerID
end if
end if

response.redirect "http://" & Request.ServerVariables ("Server_Name") & lCurBannerPath & lCurBannerBegin & lCurBannerID & lCurBannerEnd
end sub
end class
%>



The HTML is (I guess):

<A href="http://creativevp.com"><img src="http://pgh.creativevp.com/banners/vtads.asp?type=468x60" width=468 height=60 border=0 alt="Banner Ad"></A>

The link works fine, but the image is not showing up and I lack the know-how to figure out what the problem is.

Any suggestions?????