Skip to content

Instantly share code, notes, and snippets.

@nailton
Created February 26, 2014 14:59
Show Gist options
  • Save nailton/9230976 to your computer and use it in GitHub Desktop.
Save nailton/9230976 to your computer and use it in GitHub Desktop.
<?php
$cURL = curl_init('http://www.exemplo.com.br/enviaPost.php');
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
$post = array(
'nome' => 'Renan Martins Pimentel',
'email' => 'contato@renanmpimentel.com.br',
'mensagem' => 'Agora eu sei usar o cURL, demais!'
);
curl_setopt($cURL, CURLOPT_POST, true);
curl_setopt($cURL, CURLOPT_POSTFIELDS, $dados);
#Vamos deixa o site da action, como referência
curl_setopt($cURL, CURLOPT_REFERER, 'http://www.exemplo.com.br');
$interacao = curl_exec($cURL);
curl_close($cURL);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment