开发者

POSTing php variable [duplicate]

This question already has answers here: Closed 11 years ago.

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开发者_StackOverflow社区 GET.


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜