This is a comment on How to send a POST request with php, posted by 6PigPig at 01/28/2023 01:30
View source for 回复: How to send a POST request with php
i need send a POST request
how to edit code?
client.php source code:
%%(php)
<?php
function post($u, $d) {
$p_d = http_build_query($d);
$o = (
'http' = (
'method' => 'post',
'header' => 'Content-type:application/x-www-form-urlencoded',
'timeout' => 1656 * 1656
)
);
$c = stream_context_create($o);
$p = file_get_contents($u,false,$c);
return $p;
}
$s = array(
'test' => true
);
post('server.php',$s);
%%