seuges Posted April 30, 2008 Share Posted April 30, 2008 hi, everyone im kinda new at this programing thing, but for the past months i have been doing it mainly on my own. im at a really tuff obstacle, and would really appreciate if someone could assist me. so i have decided to build a membership site and i want to have an option where depending on the type of membership, a person selects. they will have access to a limited amount of free items. now what i would like to do, is create a script that will some how count the amount of time the user accesses a link, lets say, 20 is the given amount of free items. if the member clicks that link 20 times then it will be disabled. thats what i want to be able to do, it mayb appear simple to most of you, but to me its a total headache. i would really appreciate if possible an example script or just some useful tips. by the way im using php designer to write the php codes and im using dreamweaver to create the site. thanks in advance for any post to this, both +ve and -ve ones Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/ Share on other sites More sharing options...
p2grace Posted April 30, 2008 Share Posted April 30, 2008 Basically you'd create a mysql table that tracks number of times a given link is clicked by user id. When displaying the page you'd check to see if their total amounts of clicks has reached the max allowed, if it hasn't show the link. For the link, setup a redirect so when clicked it'll go to a redirect page and increment the page view for that link, then redirect again to the correct page. One thing you might want to do, is run a check on the page being viewed that does the same check as the one mentioned in the first paragraph just to make sure users don't bypass the link and go directly to that page. Hope that makes sense. Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-530398 Share on other sites More sharing options...
revraz Posted April 30, 2008 Share Posted April 30, 2008 Well you can store the link IDs in a database and each time it's pressed, have a table track the user ID that clicked it and then add them up. Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-530402 Share on other sites More sharing options...
seuges Posted April 30, 2008 Author Share Posted April 30, 2008 thnks for the replies. i have considered both of these ideas thanks to you guys and im going about executing them rite now. but i would still aprreciate if i could get some more advice or ideas, just in case the given are a bit over my head. Thanks alot again. Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-530413 Share on other sites More sharing options...
seuges Posted April 30, 2008 Author Share Posted April 30, 2008 well im a bit lost now, tell me how exactly to construct a table that would count the amount of times a link is pressed. like for example wat variables do i need to add to the table and values. i was thinking maybe i would need also to add a sql. that would probably select a link from another table when the value becomes greater than the given amount. so what exactly would be the best route to take. Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-530659 Share on other sites More sharing options...
seuges Posted May 1, 2008 Author Share Posted May 1, 2008 so i was told by some one using sql is the best option to achieve such a task. what do u guys think Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-531138 Share on other sites More sharing options...
p2grace Posted May 1, 2008 Share Posted May 1, 2008 Absolutely, that's what we've been suggesting all along Link to comment https://forums.phpfreaks.com/topic/103575-need-help-with-advance-membership-php-script/#findComment-531145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.