Home  >  Article  >  Backend Development  >  求好手帮忙把这个script转为PHP

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

WBOY
WBOYOriginal
2016-06-13 13:13:381254browse

求高手帮忙把这个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

我找了下
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()


应该是这几个 
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


------解决方案--------------------
用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));
}
?>
Statement:
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