21,887
社区成员
发帖
与我相关
我的任务
分享
<?
$data = array
(
'msg_author' => 'poster',
'msg_body' => 'gsd958gjsj sdj958fdsj',
'event' => 'comment',
'pid' => '15',
'submit' => 'OK',
);
function Post($url, $post = null)
{
$context = array();
if (is_array($post))
{
ksort($post);
$context['http'] = array
(
'method' => 'POST',
'header' => 'Cookie: 62be229b68f9a8202715cdd8c7092e31=63b33644fd6ed03214ed3887d7ead743; expires=Wed, 28-Jul-2010 13:53:37 GMT;...',
'content' => http_build_query($post, '', '&'),
);
}
return file_get_contents($url, false, stream_context_create($context));
}
echo Post('http://domain/post.php', $data);
?>