一言不合上代码.........
1 <?php 2 function getsign($data,$key){ 3 $key=MD5("KEY_".$key."_K"); 4 $sign=MD5(MD5($key.$data)); 5 return $sign; 6 7 } 8 9 echo "?u=123456&p=".getsign("test123","key01_PasswordEncryptKey")."&s=".getsign("u=123456&p=".getsign("test123","key01_PasswordEncryptKey"),"key02_SignEncryptKey");
输出结果:
1 ?u=123456&p=30413677987b25a9b4dd49205eb89a93&s=1c52ae0e7d6d31e311ff408eeadeaff5
(用户名123456密码test123)