Php script help

They have: 18 posts

Joined: Nov 2002

Hi everyone. I am wondering if there is a script or if anyone can help me create one that can do the following:

User clicks on a link and data is stored into the database (+1 value).
User tries to click on the link again.
Flood prevention is 5 minutes, so the user has to wait.
Once the time limit is up the user can click the link again and send information to the database again.

I'm making an rpg web based game like Outwar for my school.Laughing out loud

He has: 1,016 posts

Joined: May 2002

Since you don't seem to have much experience in programming/databases, I suggest you start with something simpler than a RPG game. There are tons of tutorials on PHP and MySQL on the net which should be easily found by a simple search.

Anyways, you might also want to check http://www.hotscripts.com/

Good luck

They have: 18 posts

Joined: Nov 2002

Actually, I'm just too lazy to code it myself. I already started two rpg games, and I'm experienced with databases as I just finished a CMS for a subsite on my network.

http://www.eracreations.com/members/era/phpprojects/schoolwork/jed
http://www.eracreations.com/members/era/phpprojects/game

He has: 1,016 posts

Joined: May 2002

Ok.

They have: 45 posts

Joined: Feb 2002

Well, I would suggest you use well another table or something maybe make it part of the user table but anyway.

You want to have it so when they click the link, where ever it goes it records into a column the date/time and also whenever the user clicks the link it checks the date/time that's currently stored in there and if it's 5+ minutes ago then it goes and does whatever you want it to and then it records the new date/time.

Get it?

He has: 296 posts

Joined: May 2002

Shouldn't be to hard:

User clicks on a link and data is stored into the database (+1 value).
Easy, but you'll want to store when the user clicked it, also.

User tries to click on the link again.
.....

Flood prevention is 5 minutes, so the user has to wait. Once the time limit is up the user can click the link again and send information to the database again.
Have the script check the DB for the user, if user exists: get time last clicked, then get the current time and make sure it's been 5 minutes. If less, return error. If more, return link URL.

[James Logsdon]

They have: 18 posts

Joined: Nov 2002

Okay, I got the flood control to work. Thanks.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.