JoeSnow
05-26-2009, 03:15 PM
Hi CodingForums,
Im new here, I require some help on a MySQL and PHP script I'm trying to create.
I really only know the basics with PHP and MySQL. However I'm not able to figure out how to do this.
I'm coding a game in Java, which I'm quite good at doing. Basically, there is a site -> ingame reward system. If they vote for the game to be good, they get an ingame reward, which I've coded using a command set by myself. I've created a collum in my "characters" table named "voting". When I use the ingame command it checks if "voting" is set to 1, if it is, it gives the user his reward and then resets "voting" back to 0.
I would be very greatful, if anyone could show me how to make a PHP script for the site, that would set the collum "voting" in "characters" table to 1 after using it. However it needs to wait 12 hours until the user can do it again, that is where my problem is. And if the users returns for a second attempt within that time, then they are not allowed to vote again until the 12 hours has passed. If possible could anyone write me this script in PHP with MySQL if they would be really nice? Also, we have some tricky people on the site who will seek out ways to bypass this, like clearing cookies, changing there IP and maybe more ways. If possible can it not involve just saving IP/Cookies until the timer is up.
Thanks to anyone that reads and helps - Joe.
Im new here, I require some help on a MySQL and PHP script I'm trying to create.
I really only know the basics with PHP and MySQL. However I'm not able to figure out how to do this.
I'm coding a game in Java, which I'm quite good at doing. Basically, there is a site -> ingame reward system. If they vote for the game to be good, they get an ingame reward, which I've coded using a command set by myself. I've created a collum in my "characters" table named "voting". When I use the ingame command it checks if "voting" is set to 1, if it is, it gives the user his reward and then resets "voting" back to 0.
I would be very greatful, if anyone could show me how to make a PHP script for the site, that would set the collum "voting" in "characters" table to 1 after using it. However it needs to wait 12 hours until the user can do it again, that is where my problem is. And if the users returns for a second attempt within that time, then they are not allowed to vote again until the 12 hours has passed. If possible could anyone write me this script in PHP with MySQL if they would be really nice? Also, we have some tricky people on the site who will seek out ways to bypass this, like clearing cookies, changing there IP and maybe more ways. If possible can it not involve just saving IP/Cookies until the timer is up.
Thanks to anyone that reads and helps - Joe.