Jump to content


Photo

100th click script?


  • Please log in to reply
3 replies to this topic

#1 Veto

Veto
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 19 May 2006 - 08:00 AM

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

#2 Crimpage

Crimpage
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts
  • LocationBrisbane, Australia

Posted 19 May 2006 - 10:52 AM

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

#3 Veto

Veto
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 21 May 2006 - 02:03 AM

[!--quoteo(post=375180:date=May 19 2006, 06:52 PM:name=Crimpage)--][div class=\'quotetop\']QUOTE(Crimpage @ May 19 2006, 06:52 PM) View Post[/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!

#4 maexus

maexus
  • Members
  • PipPipPip
  • Advanced Member
  • 191 posts

Posted 21 May 2006 - 03:05 AM

[!--quoteo(post=375624:date=May 20 2006, 09:03 PM:name=Veto)--][div class=\'quotetop\']QUOTE(Veto @ May 20 2006, 09:03 PM) View Post[/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']




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users