Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/9984-100th-click-script/
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
Link to comment
https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37116
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!
Link to comment
https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37547
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']
Link to comment
https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37563
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.