how do i make post variables obsolete?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
HomerTheDragoon
Forum Newbie
Posts: 21
Joined: Sat Jul 08, 2006 2:10 am

how do i make post variables obsolete?

Post by HomerTheDragoon »

How do i acomplish this?
so lets say i have stats on a mysql server database. And when u get sent to a certain page with a certain post variable set to something, your stats go up. How do i make it so you wouldnt be able to keep refreshing to boost your stats?

Thanks.
bdlang
Forum Contributor
Posts: 395
Joined: Tue May 16, 2006 8:46 pm
Location: Ventura, CA US

Post by bdlang »

Good point. What is the basis to give the user stat points in the first place? Triggered by a specific task the user did or by an event? I'd wager you could provide some logical constraint based on this 'event' that would only allow the user stat points when and if the event was complete, not simply by linking to another script. Have the script check a table `Events` and see if the user completed the task or not. If so, don't allow any more stat points.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

unique, one-time use transactions.
HomerTheDragoon
Forum Newbie
Posts: 21
Joined: Sat Jul 08, 2006 2:10 am

Post by HomerTheDragoon »

I dont want them to be one time used, but just so you can not abuse it. Since you will be able to repeat these tasks over and over. Therefor increaseing your stats, however I want it so the players have to work for it. Im going to be using flash for the tasks. and after you complete it, it does so and so.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I use cookies for stats for pages. I know this is not the same exact thing, but I use a cookie to check to see if the current page loaded is the same as the last page loaded so I know if I need to up my page counter or not. I am sure you could use some sort of cookie/session mechanism to manage stat updating.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Unique, one-time use transactions doesn't mean you can't repeat an action, but it does make each transactopn taken only possible once.

How they work is you create and record a transaction ID into the database. This record would hold details of what action to take. Once the transaction has been touched, you mark the record as used or delete the record. The transaction should be linked to the user so another user cannot take the transaction for themselves and only known transactions should be allowed to be executed. I would also make the transactions self-terminate after a period of time from their creation.
HomerTheDragoon
Forum Newbie
Posts: 21
Joined: Sat Jul 08, 2006 2:10 am

Post by HomerTheDragoon »

thats a pretty good idea :P.

thanks.
Post Reply