Ali
Ali

Reputation: 267317

How to remotely submit a form through PHP?

How can I remotely submit a web form with POST variables using PHP 5.2?

Upvotes: 1

Views: 1459

Answers (1)

Patrick
Patrick

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

Related Questions