复制代码 代码如下:
<?php
require_once("../php/phprpc_server.php");
$server = new PHPRPC_Server();
$server->add("sha1");
$server->start();
?>
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>计算 SHA1</title>
<script type="text/javascript" src="../js/compressed/phprpc_client.js"></script>
<script type="text/javascript">
var rpc = new PHPRPC_Client('sha1.php', ['sha1']);
function $(id) {
return document.getElementById(id);
}
function showResult(result) {
$('sha1').value = result;
}
function sha1() {
var input = $('sha1').value;
$('sha1').value = "Loading...";
rpc.sha1(input, showResult);
}
</script>
</head>
<body>
<input type="text" />
<input type="button" value="计算 SHA1" />
</body>
</html>
复制代码 代码如下:
var rpc = new PHPRPC_Client('sha1.php', ['sha1']);
复制代码 代码如下:
rpc.sha1(input, showResult);
当前1/2页
新闻热点
疑难解答