salt.php function getAuthKey($post_data=null) { if(!$post_data) return -1;ksort($post_data);$_post_data_str = '';foreach ($post_data as $pd_key = $pd_value) {$_post_data_str .= $pd_key . '=' . $pd_value . '';}$_salt_data = $_post_data_str .
function getAuthKey($post_data=null) { if(!$post_data) return -1; ksort($post_data); $_post_data_str = ''; foreach ($post_data as $pd_key => $pd_value) { $_post_data_str .= $pd_key . '=' . $pd_value . '&'; } $_salt_data = $_post_data_str . 'key=2e5b08511eaac0da57b47571a346d4ec'; $_salt_str = strtoupper(md5($_salt_data)); return $_salt_str; } function checkAuth($post_data=null, $salt_key='salt') { if( ! $post_data ) return -1; if( ! array_key_exists($salt_key, $post_data) ) return -2; ksort($post_data); $data_salt_key = $post_data[$salt_key]; unset($post_data[$salt_key]); $_post_data_str = ''; foreach ($post_data as $pd_key => $pd_value) { $_post_data_str .= $pd_key . '=' . $pd_value . '&'; } $_salt_data = $_post_data_str . 'key=2e5b08511eaac0da57b47571a346d4ec'; $_salt_str = strtoupper(md5($_salt_data)); if( $data_salt_key!=$_salt_str ) return 0; return 1; }