malhyp
01-23-2007, 05:57 AM
Hey there... Can one help me with the follwong code?
The banner ad i have installed seems to work almost fine. When you click onto the pic (banner ad) it takes me to the address below instead of the one intended.
<%
Response.Buffer=True
'Define our ADO constants
const adOpenStatic = 3
const adLockOptimistic = 3
'----- Create and Open Connection
Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\blablabla"
MyConnection.Open
'----- Pick Ad from database
SQLBanner = "Select * from Banner"
Set Banners = Server.CreateObject("ADODB.Recordset")
Banner.CursorType = adOpenStatic
BannersLockType = adLockOptimistic
Banner.Open SQLBanners, MyConnection
Randomize Timer
Banner.Move Int(RND * CInt(Banner.RecordCount))
'----- Increment Shown field value
Banner("Shown") = Banner("Shown") + 1
Banner.Update
' <a href="RedirectMe.asp?URL="www.google.com&BannerID="1"" "target="blank">image</a>
'----- Create and display Response
ImageString = "<img src=""" & Banner("Image") & """ alt=""" & Banner("Hint") & """>"
'ImageString = "<a href=""" & Banner("Image") & """ target=""_blank""><img src=""" & Banner("Image") & """ alt=""" & Banner("Hint") & """></a>"
ResponseString = "<a href=""RedirectMe.asp?URL=" & Banner("URL")
ResponseString = ResponseString & "&BannerID=" & Banner("BannerID") & """" & " " & "target=""_blank""" & ">" & ImageString & "</a>"
Response.Write ResponseString
'Response.End
'----- Clean up memory
Banner.Close
MyConnection.Close
Set Banner=Nothing
Set MyConnection=Nothing
%>
---------------------------------------------------------
Takes me here...
http://www.example.com/html/products/RedirectMe.asp?URL=www.test.com&BannerID=1
But need it to go here...
www.test.com
Can anyone tell me what I am doing wrong?
Mally
The banner ad i have installed seems to work almost fine. When you click onto the pic (banner ad) it takes me to the address below instead of the one intended.
<%
Response.Buffer=True
'Define our ADO constants
const adOpenStatic = 3
const adLockOptimistic = 3
'----- Create and Open Connection
Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\blablabla"
MyConnection.Open
'----- Pick Ad from database
SQLBanner = "Select * from Banner"
Set Banners = Server.CreateObject("ADODB.Recordset")
Banner.CursorType = adOpenStatic
BannersLockType = adLockOptimistic
Banner.Open SQLBanners, MyConnection
Randomize Timer
Banner.Move Int(RND * CInt(Banner.RecordCount))
'----- Increment Shown field value
Banner("Shown") = Banner("Shown") + 1
Banner.Update
' <a href="RedirectMe.asp?URL="www.google.com&BannerID="1"" "target="blank">image</a>
'----- Create and display Response
ImageString = "<img src=""" & Banner("Image") & """ alt=""" & Banner("Hint") & """>"
'ImageString = "<a href=""" & Banner("Image") & """ target=""_blank""><img src=""" & Banner("Image") & """ alt=""" & Banner("Hint") & """></a>"
ResponseString = "<a href=""RedirectMe.asp?URL=" & Banner("URL")
ResponseString = ResponseString & "&BannerID=" & Banner("BannerID") & """" & " " & "target=""_blank""" & ">" & ImageString & "</a>"
Response.Write ResponseString
'Response.End
'----- Clean up memory
Banner.Close
MyConnection.Close
Set Banner=Nothing
Set MyConnection=Nothing
%>
---------------------------------------------------------
Takes me here...
http://www.example.com/html/products/RedirectMe.asp?URL=www.test.com&BannerID=1
But need it to go here...
www.test.com
Can anyone tell me what I am doing wrong?
Mally