newb Posted April 3, 2008 Share Posted April 3, 2008 HI im looking for a way to limit the number of times a registered user can access a page on my site. any suggestions or ideas on how this can be implemented through php & sql tables? thanks. Quote Link to comment Share on other sites More sharing options...
almightyegg Posted April 3, 2008 Share Posted April 3, 2008 Just have an mysql update on that page that updates column pageviews in the users row +1. then if($user[pageviews] >= x amount){ echo "You have viewed this page too many times"; }else{ //rest of page } Quote Link to comment Share on other sites More sharing options...
trq Posted April 3, 2008 Share Posted April 3, 2008 Each time they access a page increment a filed in your database. when it gets to your limit, prevent further access. Quote Link to comment Share on other sites More sharing options...
cammarata123 Posted April 3, 2008 Share Posted April 3, 2008 when the page is visited have a counter table(user,counter) and get the counter for that user. The update the table by adding one to the counter for that user. Then if the counter is greater than a certain value, don't give them access to the page Quote Link to comment Share on other sites More sharing options...
newb Posted April 3, 2008 Author Share Posted April 3, 2008 oh i see, thanks. Quote Link to comment 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.