php - How send another POST from inside a POST -
i trying send post getting empty post on other script. doing wrong?
if(isset($_post)){ $url = 'http://localhost:3000/post'; $data = $_post; $options = array( 'http' => array( 'header' => "content-type: application/x-www-form-urlencoded\r\n", 'method' => 'post', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); }
this sync between 2 apps. when replace
$data = $_post;
by
$data = array('key1' => 'value1', 'key2' => 'value2');
works charm!
thanks!
the problem how, wordpress deleting $_post @ point , after i've moved code top of file, problem resolved. all!
php wordpress
No comments:
Post a Comment