Skip to content

Instantly share code, notes, and snippets.

@wescleymatos
Created February 9, 2012 12:17
Show Gist options
  • Select an option

  • Save wescleymatos/1779589 to your computer and use it in GitHub Desktop.

Select an option

Save wescleymatos/1779589 to your computer and use it in GitHub Desktop.
Submeter dados por post para uma página remota
<?php
$content = http_build_query(array(
'cidade' => 'Rio de Janeiro',
'tipo' => 'Apartamento',
));
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'content' => $content,
)
));
$contents = file_get_contents('http://exemplo/teste.php', null, $context);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment