diff --git a/core.php b/core.php index 2833d20..1eb3d61 100644 --- a/core.php +++ b/core.php @@ -6,4 +6,22 @@ $rooturl = $_SERVER['HTTP_HOST']; $domain = preg_replace('/^www\./', '', $rooturl); $static_release = "2016122717430333"; -?> \ No newline at end of file + function curlrequest($url, $data, $method="post") { + $ch = curl_init(); // 初始化CURL句柄 + curl_setopt($ch, CURLOPT_URL, $url); // 设置请求的URL + curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // 设为TRUE把curl_exec()结果转化为字串,而不是直接输出 + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); // 设置请求方式 + curl_setopt($ch, CURLOPT_REFERER,$url); // 构造来路 + curl_setopt($ch, CURLOPT_HTTPHEADER,array("X-HTTP-Method-Override: $method")); // 设置HTTP头信息 + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // 设置提交的字符串 + $document = curl_exec($ch); // 执行预定义的CURL + if(!curl_errno($ch)) { + $info = curl_getinfo($ch); + echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url']; + } else { + echo 'Curl error: ' . curl_error($ch); + } + curl_close($ch); + // $document=preg_replace("/[\t\n\r]+/","",$document); + return $document; + } \ No newline at end of file diff --git a/post.php b/post.php new file mode 100644 index 0000000..1ff5a25 --- /dev/null +++ b/post.php @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/remote_reg.php b/remote_reg.php new file mode 100644 index 0000000..6e63dc1 --- /dev/null +++ b/remote_reg.php @@ -0,0 +1,11 @@ + -->
-
+
@@ -84,7 +84,7 @@
- +
diff --git a/test.php b/test.php new file mode 100644 index 0000000..a243049 --- /dev/null +++ b/test.php @@ -0,0 +1,3 @@ + \ No newline at end of file