Reply
Help with banner ad...
Old 01-23-2007, 12:58 AM Help with banner ad...
Skilled Talker

Posts: 68
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
malhyp is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 01-23-2007, 10:39 AM Re: Help with banner ad...
bbutton's Avatar
Experienced Talker

Posts: 43
Name: Bill Button
Location: Reading,UK
Hi,

What domain are you running your asp on?
If you are using IE have you unckecked the Box Show Friendly HTTP Errors in Tools/Internet Options/Advanced Options.

The error may be inside the RedirectMe.asp

Regards
Bill Button
http://www.rodmatic.com


bbutton is offline
Reply With Quote
View Public Profile Visit bbutton's homepage!
 
Old 01-24-2007, 04:33 AM Re: Help with banner ad...
Skilled Talker

Posts: 68
Thats probably it, I cant find a page called redirectme.asp
malhyp is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with banner ad...
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12319 seconds with 13 queries