fmhsong/site/center/libraries/post.php
2022-05-20 19:21:39 +08:00

27 lines
693 B
PHP

<?php
/*
Copyright GHINK Network Studio
Author: Bigsk(https://www.xiaxinzhe.cn)
*/
if(!defined('IN_SYS')){//Defined entreance security.
header('HTTP/1.1 403 Forbidden');
exit();
}
function sendPost($url, $post_data) {
$postdata=http_build_query($post_data);
$options=array(
'ssl' => array(
'verify_peer' => false,
),
'http' => array(
'method' => 'POST',
'header' => 'Content-type:application/x-www-form-urlencoded',
'content' => $postdata,
'timeout' => 15*60
)
);
$context=stream_context_create($options);
$result=file_get_contents($url,false,$context);
return $result;
}