Reputation: 267317
How can I remotely submit a web form with POST variables using PHP 5.2?
Upvotes: 1
Views: 1459
Reputation: 3172
a very basic POST curl
$data = array(
'submit' => 'submit',
'field_1' => 'bleh'
);
$ch = curl_init('http://example.com');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec();
Upvotes: 5