PHP - hide url (GET) parameters

前端 未结 7 1388
梦谈多话
梦谈多话 2020-12-06 03:45

I have a link in my PHP/HTML like this:



        
7条回答
  •  Happy的楠姐
    2020-12-06 04:29

    You can generate tokens for this functions: in your database generate an random string: This is an function which returns an random string

    function gt_rnd_str($min=2,$max=9){
        $str="";
        while (strlen($str)<$max) 
            $str.=rtrim(base64_encode(md5(microtime())),"=");
        return substr($str, 0, rand($min, $max));
    }
    

    now save an token with username/id and using this you can easily generate more tokens for same user as well as cancel any token easily..

提交回复
热议问题