用于测试api接口数据的输入输出
程序员文章站
2024-01-18 19:41:40
...
1. [代码][PHP]代码
<?php $created = time(); $get = json_encode($_GET ); $post = json_encode($_POST ); $input = file_get_contents ( 'php://input' ); $cookie = json_encode($_COOKIE); $con = mysql_connect("localhost","root","admin"); mysql_select_db("api_test", $con); $sql = "INSERT INTO api (created, get, post, input, cookie) VALUES ('$created', '$get', '$post', '$input', '$cookie')"; //echo $sql."\n"; mysql_query($sql,$con); mysql_close($con); $str = ''; echo $str; ?>
上一篇: undo表空间