PHP anti-malicious refresh implementation code. Copy the code as follows :? Phpsession_start (); $ k $ _ GET [k]; $ t $ _ GET [t]; $ allowTime1800; anti-refresh time $ ipget_client_ip (); $ allowTmd5 ($ ip. $ k. $ t); if (! Isset ($ _ SESS
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 http://www.bkjia.com/PHPjc/321927.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/321927.htmlTechArticle code is as follows :? Php session_start (); $ k =$ _ GET ['K']; $ t =$ _ GET ['t']; $ allowTime = 1800; // Anti-refresh time $ ip = get_client_ip (); $ allowT = md5 ($ ip. $ k. $ t); if (! Isset ($ _ SESS...