Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flood check

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, all.

I really need help on a IP flood check code for my script. I need it to make a row into my table 'flood' and delete the row after 5 minutes, or whatever the scripts control panel option is set to. Also, for it to only allow ONE IP address for a row, so if they refresh with the same IP and the scripts attempts to add another row, instead of adding one with the same IP, it won't add the row.

I'll do the rest from there, by checking if an IP exists in a row, and then displaying an error message.

Thanks in advance.

-William
 
Oke i think you have to do it like this:

Step 1. Every time someone logs in you insert a row with the ip and a timestamp of the login time.
Step 2. If the user refreshes update the timestamp.
Step 3. This should be done in step 1 and step 2. Check if there are any timestamps older than 5 minutes (300 sec that is). If so delete the rows older than 5 minutes.

Is this what you are looking for? mcvdmvs
"It never hurts to help" -- Eek the Cat
 
Thank you for the reply, mcvdmvs, but how do I do step number three?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top