可能重复: 用cURL发布值
我有一个php变量$abc (文本类型)。我想把这些数据发到http://www.example.com/xyz.php,我该怎么做呢?我不能用GET。
发布于 2011-07-16 14:52:34
你可以用cURL扩展
$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);https://stackoverflow.com/questions/6718077
复制相似问题