2

Possible Duplicate:
Passing $_POST values with cURL

I have a php variable $abc (text type). And I want to POST this data to http://www.example.com/xyz.php How can I do this? I cant use GET.

Community
  • 1
  • 1

1 Answers1

2

You could use cURL extension:

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://www.example.com/xyz.php");
curl_setopt($curl, CURLOPT_POST, true);

$post = array(
    'key' => 'value'
);

curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_exec($curl);
Ondrej Slinták
  • 31,386
  • 20
  • 94
  • 126