author:zbseoag
仅限于本地使用,不要放在服务器上
**/
error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');if (!empty($_REQUEST)){
(new Tool($_REQUEST['data']))->{$_REQUEST['action']}();exit;
}?>
我的工具包* {padding: 0; margin: 0;font: 14px "微软雅黑"; }
html,body { width: 100%; }
button { padding:4px 10px; }.button {padding: 4px 10px; min-width: 110px; margin: 4px 0; }
li {margin-bottom:10px; }
table{ border-collapse:collapse; }
tr{ border: 1px solid #CCC; }
td, th{ border: 1px solid #CCC; }
源码
清空
Shell (S)
Python (P)
Lua (L)
PHP (H)
C 语言 (C)
Java (J)
Go (G)
var log = console.log;functionel(id){return document.getElementById(id);
}
asyncfunctionget(url){if(type == 'json'){return await fetch(url).then(response => response.json());
}else{return await fetch(url).then(response => response.text());
}
}
asyncfunction post(url, data, type='text'){
let form= newFormData();for(let keyin data) {
form.append(key, data[key]);
}
let option= {method:'POST', body:form};if(type == 'json'){return await fetch(url, option).then(response => response.json());
}else{return await fetch(url, option).then(response => response.text());
}
}classForm {
constructor(id, url=''){
this.option ={'header':new Headers(),
'method':'P