Little help here will pay if needed

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

alcapone

Established Member
Impact
0
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
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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 :-?
 
0
Close
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.
 
0
Close
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.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back