Seg

session_cache_expire(10); //tempo de sessão igual 10 minutos session_start(); session_name(md5('seg'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT'])); session_start(); if(isset($_POST)){ if($_SESSION['token'] == $_POST[‘token’]){ //post valido } }else{ $_SESSION['token'] = md5(time()); //adicione o token em um input hidden }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.