We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,166 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Help with java script and banner

Hello guys and gals
I have created a banner for my client. It's a image banner not flash, with common html coding
Eg
<a href="http://www.mysite.com"><img src="http://www.mysite.com/banners/2-12/160x600_5.jpg" width=160 height=600 border=1 ALT="Click to Visit"></a>

Now my client gave me an URL, which is a tracking code of some affiliate network. I need to implement that in my banner, so that when somebody click the tracking code will record it's click and it should take to particular address

I have seen this trick in flash banner.
Now I need to know the same trick in javascript or in html

any help is welcome

Please suppose tracking code as http:// www.tracking. com/asd/jkl/ghj.html

and please post here with tracking code inserted in to banner code

2
Contributors
2
Replies
3 Hours
Discussion Span
1 Year Ago
Last Updated
3
Views
ayushsocial
Newbie Poster
3 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

So you have an image, a link that surrounds it and you want to record whether a visitor clicks on it?

The easiest way is to make a link to a PHP page, e.g. referer.php. This page would take a link as argument and then increment the amount of clicks for that link in a database:

<a href='referer.php?link=http://www.mysite.com'><img src="http://www.mysite.com/banners/2-12/160x600_5.jpg" width='160' height='600' border='1' alt="Click to Visit" /></a>

And then in referer.php you retrieve the link using GET, increment a value in a table (something like 'referer_counter') with columns 'link' (string) and 'counter' (integer) that corresponds with the link and then automatically redirect (google how to do it) the visitor to the correct link.

PS: If it's a rotation banner, you need to change the href everytime a new image is loaded.

~G

Graphix
Posting Pro in Training
434 posts since Aug 2009
Reputation Points: 82
Solved Threads: 75
Skill Endorsements: 0

So you have an image, a link that surrounds it and you want to record whether a visitor clicks on it?

The easiest way is to make a link to a PHP page, e.g. referer.php. This page would take a link as argument and then increment the amount of clicks for that link in a database:

<a href='referer.php?link=http://www.mysite.com'><img src="http://www.mysite.com/banners/2-12/160x600_5.jpg" width='160' height='600' border='1' alt="Click to Visit" /></a>

And then in referer.php you retrieve the link using GET, increment a value in a table (something like 'referer_counter') with columns 'link' (string) and 'counter' (integer) that corresponds with the link and then automatically redirect (google how to do it) the visitor to the correct link.

PS: If it's a rotation banner, you need to change the href everytime a new image is loaded.

~G

Thanx Graphix
I don't know php
So can you please post
coding here
of php page

ayushsocial
Newbie Poster
3 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0648 seconds using 2.75MB