求好手帮忙把这个script转为PHP

WBOY
Release: 2016-06-13 13:13:38
Original
1203 people have browsed it

求高手帮忙把这个script转为PHP

JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->http://st1.dbank.com/netdisk/js/custom-hp-one.js?v=2.6.0aa
Copy after login

我找了下
JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->nsp_svc:=com.dbank.signin.signin
anticache: Math.floor(Math.random() * 1000)
nsp_sid: g.cookie("session"),
nsp_ts: m + new Date().getTime()
var u = h(w);
v = g.cookie("secret") + u;
nsp_key: g.md5(v).toLocaleUpperCase()
Copy after login


应该是这几个 
nsp_sid这个明白是从COOKIE中获取session值
其他的看不懂。。


最终效果如下
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->http://api.dbank.com/rest.php?nsp_svc=com.dbank.signin.signin&anticache=135&nsp_sid=kuCoeiUua7n1NuaNghwuaPnZ.YJqLlTBkV1rM.dCSLowAv9Z&nsp_ts=1341795427238&nsp_key=74CE86E17DE7C554FCDBCACEC60C5B3F&nsp_fmt=JS&nsp_cb=_jqjsp
Copy after login


------解决方案--------------------
用PHP很简单的哦.

官方就已经给出源码了.

http://open.dbank.com/appDatabase.html?v=2.6.2

function signRequest($secret, $param) {
$str = $secret;
ksort($param);
foreach ($param as $k=>$v) {
$str .= $k .$v;
}
 
return strtoupper(md5($str));
}
?>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!