Veto Posted May 19, 2006 Share Posted May 19, 2006 hey all.. i am new here n to the forum as well... hope you guys can help me here :Pi 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 advanceVeto Quote Link to comment https://forums.phpfreaks.com/topic/9984-100th-click-script/ Share on other sites More sharing options...
Crimpage Posted May 19, 2006 Share Posted May 19, 2006 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 Link to comment https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37116 Share on other sites More sharing options...
Veto Posted May 21, 2006 Author Share Posted May 21, 2006 [!--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! Quote Link to comment https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37547 Share on other sites More sharing options...
maexus Posted May 21, 2006 Share Posted May 21, 2006 [!--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'] Quote Link to comment https://forums.phpfreaks.com/topic/9984-100th-click-script/#findComment-37563 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.