Home > Backend Development > PHP Tutorial > Anti-malicious click system PHP anti-malicious refresh implementation code

Anti-malicious click system PHP anti-malicious refresh implementation code

WBOY
Release: 2016-07-29 08:42:43
Original
1346 people have browsed it

Copy the code The code is as follows:


session_start();
$k=$_GET['k'];
$t=$_GET['t'];
$allowTime = 1800; // Anti-refresh time
$ip = get_client_ip();
$allowT = md5($ip.$k.$t);
if(!isset($_SESSION[$allowT]))
{
$refresh = true;
$_SESSION[$allowT] = time();
}elseif(time() - $_SESSION[$allowT]>$allowTime){
$refresh = true;
$_SESSION[$allowT] = time ();
}else{
$refresh = false;
}
?>

The above introduces the anti-malicious click system PHP anti-malicious refresh implementation code, including the content of the anti-malicious click system. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template