Jump to content

Archived

This topic is now archived and is closed to further replies.

Veto

100th click script?

Recommended Posts

hey all.. i am new here n to the forum as well... hope you guys can help me here :P

i was wondering, if it is possible to code with PHP, to make a counter script which track unique visitors clicked on a link. and once the link has been unique-clicked on the 100th time, the script will then open up a page to collect the visitors information to give them prize or something like that :)

im sure this will be complicated n thus hope you guys can help :)

thanks in advance
Veto

Share this post


Link to post
Share on other sites
Hi,

You will need to write the IP addresses to a table / file somewhere so that each new click, you know is unique or not.

On your checking page, you will need to query that with "select count(*) from TABLE_NAME where ipaddress = 'WHATEVER'" if it returns a count higher than 0, you know its not unique.

You can then add the IPADDRESS to the table. then "SELECT count(*) from TABLE_NAME" and if it equals 100... Hooray! Lucky them for wining a random internet prize...

Dave

Share this post


Link to post
Share on other sites
[!--quoteo(post=375180:date=May 19 2006, 06:52 PM:name=Crimpage)--][div class=\'quotetop\']QUOTE(Crimpage @ May 19 2006, 06:52 PM) [snapback]375180[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi,

You will need to write the IP addresses to a table / file somewhere so that each new click, you know is unique or not.

On your checking page, you will need to query that with "select count(*) from TABLE_NAME where ipaddress = 'WHATEVER'" if it returns a count higher than 0, you know its not unique.

You can then add the IPADDRESS to the table. then "SELECT count(*) from TABLE_NAME" and if it equals 100... Hooray! Lucky them for wining a random internet prize...

Dave
[/quote]

thanks for the reply dave.

a few questions regarding ur post above :

1. is there anyway for me not to input the ip addresses manually? like getting it automatically on the first time the user visits the page without him knowing any of this (asking for him to fill in n stuff)?

2. is this all possible using php alone? if it is, can u point me to the correct path on making this script? like which syntax to use, any webites that teach me how to do it aor something like that due to the fact this is my FIRST attempt on php :(

thanks!

Share this post


Link to post
Share on other sites
[!--quoteo(post=375624:date=May 20 2006, 09:03 PM:name=Veto)--][div class=\'quotetop\']QUOTE(Veto @ May 20 2006, 09:03 PM) [snapback]375624[/snapback][/div][div class=\'quotemain\'][!--quotec--]
thanks for the reply dave.

a few questions regarding ur post above :

1. is there anyway for me not to input the ip addresses manually? like getting it automatically on the first time the user visits the page without him knowing any of this (asking for him to fill in n stuff)?

2. is this all possible using php alone? if it is, can u point me to the correct path on making this script? like which syntax to use, any webites that teach me how to do it aor something like that due to the fact this is my FIRST attempt on php :(

thanks!
[/quote]

1: $_SERVER['REMOTE_ADDR']

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.