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. Link to comment https://forums.phpfreaks.com/topic/99358-solved-suggestions-pls-need-help-gtd/ 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 } Link to comment https://forums.phpfreaks.com/topic/99358-solved-suggestions-pls-need-help-gtd/#findComment-508346 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. Link to comment https://forums.phpfreaks.com/topic/99358-solved-suggestions-pls-need-help-gtd/#findComment-508348 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 Link to comment https://forums.phpfreaks.com/topic/99358-solved-suggestions-pls-need-help-gtd/#findComment-508351 Share on other sites More sharing options...
newb Posted April 3, 2008 Author Share Posted April 3, 2008 oh i see, thanks. Link to comment https://forums.phpfreaks.com/topic/99358-solved-suggestions-pls-need-help-gtd/#findComment-508424 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.