Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 09-22-2007, 04:51 PM   PM User | #1
Arnack
New Coder

 
Join Date: Nov 2005
Posts: 58
Thanks: 1
Thanked 0 Times in 0 Posts
Arnack has a little shameless behaviour in the past
Simple Question About Checking Whether a user click on a link or not

Yes, I'm making a website and what I need to know is about a simple script that would see if a user clicked on 5 or more affiliate banners/ads given. Once the user has clicked 5 or more, a button would appear, and once you click on that, an email would be sent to me.
Anyone know?
Arnack is offline   Reply With Quote
Old 09-23-2007, 01:33 AM   PM User | #2
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,198
Thanks: 26
Thanked 70 Times in 70 Posts
Len Whistler is on a distinguished road
I would direct all banner clicks to a second file,which then redirects to the advertiser. Use sessions or cookies to keep track of how many times advertiser.php loads during their visit. The syntax below may be incorrect, but it should give you a starting point.

PHP Code:
"<a href=\"advertiser.php?id=01\"></a>";
"<a href=\"advertiser.php?id=02\"></a>";
"<a href=\"advertiser.php?id=03\"></a>"
advertiser.php
PHP Code:
<?php
$_GET
['id'];

if (
$_GET['id'] = 01) {
header ("Location: http://www.advertiser_one.com");
}
if (
$_GET['id'] = 02) {
header ("Location: http://www.advertiser_two.com");
}
if (
$_GET['id'] = 03) {
header ("Location: http://www.advertiser_three.com");
}
?>
__________________
Leonard Whistler

Last edited by Len Whistler; 09-23-2007 at 01:37 AM..
Len Whistler is offline   Reply With Quote
Old 09-23-2007, 01:58 AM   PM User | #3
bazz
Senior Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 4,842
Thanks: 37
Thanked 167 Times in 163 Posts
bazz will become famous soon enoughbazz will become famous soon enough
I agree with using sessins but, after the five visits have been reached maybe you could use a conditional to run a sub, whihc emails you. That should save the errors from poeple who don't want to click.

bazz
bazz is offline   Reply With Quote
Old 09-23-2007, 03:21 AM   PM User | #4
Arnack
New Coder

 
Join Date: Nov 2005
Posts: 58
Thanks: 1
Thanked 0 Times in 0 Posts
Arnack has a little shameless behaviour in the past
Thank you, Len Whistler. That helped!!
Arnack is offline   Reply With Quote
Old 09-24-2007, 02:14 AM   PM User | #5
Arnack
New Coder

 
Join Date: Nov 2005
Posts: 58
Thanks: 1
Thanked 0 Times in 0 Posts
Arnack has a little shameless behaviour in the past
But wait, I'm going to be using at least 100 ads they have to choose to click on (they only have to click on 3). so how would I make a special page for each and every one advertisement?
Arnack is offline   Reply With Quote
Old 09-24-2007, 03:22 AM   PM User | #6
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,198
Thanks: 26
Thanked 70 Times in 70 Posts
Len Whistler is on a distinguished road
I assume these "affiliate banners/ads" are external URL links? Or are they internal links? Or do you just want to count the clicks on banners that doesn't take you anywhere?

Keeping track of 100 different clicks will be a big coding job, I recommend PHP and a MySQL database.
__________________
Leonard Whistler
Len Whistler is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:13 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.