Hello, I have a site about a game and i need if there is some code that helps me to anti-flood, please.thanks!
if anyone can help me I would greatly appreciate

This it's good?

<?PHP

IF (!ISSET($_SESSION)) {
    SESSION_START();
}
// anti flood protection
IF($_SESSION['last_session_request'] > TIME() - 2){
    // users will be redirected to this page if it makes requests faster than 2 seconds
    HEADER("location: /flood.html");
    EXIT;
}
$_SESSION['last_session_request'] = TIME();

?>
Member Avatar for LastMitch

@cristian.stilpeanu.3

Hello, I have a site about a game and i need if there is some code that helps me to anti-flood, please.thanks!

I'm a bit confused why you need help with this code that you post above.

I assume you got it from here:

http://www.thewebhelp.com/php/scripts/anti-flood-script/

I think it explained very clearly about where to put it.

Or you can try this one:

https://github.com/desfrenes/Shozu/blob/master/AntiFlood.php

The reason is that there's section where you can post your question and ask for assistant.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.