| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Feb 2005
Posts: 165
![]() | little help here will pay if needed im wondering how i would make a php page only be allowed to be used twice its a certain page in a rpg game that will wipe out all men it is a attack but i want to limit it to be used twice per round so i will need a calling to mysql for hitman that will noty allow it if they try to attack that player but they can still attack other players but limited to two times per player
__________________ Hostile-Territory |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Sep 2005
Posts: 160
![]() | I don't know if I understood your problem, but it seems an easy thing to code. When entering that page, just check the number of times that user entered it before and, if this number is >1 (i.e. == 2) you know he already accesed it two times for that date. Just show a warning and return :-? |
| |
| | #3 (permalink) |
| Senior Member Join Date: Aug 2005
Posts: 1,717
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | You will obviously need a way to keep count of how many hits the page has received and you could use either a flat file or a database table to store the data. Another option is to use php sessions and set this page hit count as a session variable. |
| |
| | #4 (permalink) |
| I'll do it ![]() Join Date: Dec 2005 Location: India
Posts: 6,927
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | I have one more thing to add here. Just make sure that search engine bots don't get confused in this situation. Moreover if you make special privileges for search engine bots then it will be considered as cloaking. So please think of a way to show the page to users after they login or something and then over there you can track them according to their usernames or userid's Thanks.
__________________ |
| |