0
I have the following code snippet. Taken from this website. I want to send the values described below to another page through POST (without using form or AJAX). My doubt is how do I recover the values on the other page and what exactly this method (file_get_contents ) does.
$content = http_build_query(array(
'field1' => 'Value1',
'field2' => 'Value2',
'field3' => 'Value3',
));
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'content' => $content,
)
));
$result = file_get_contents('http://exemplo/make_action.php', null, $context);
$content = http_build_query(array(
'field1' => 'Value1',
'field2' => 'Value2',
'field3' => 'Value3',
));
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'content' => $content,
)
));
$result = file_get_contents('http://exemplo/make_action.php', null, $context);