- 论坛徽章:
- 0
|
- $ch = curl_init();
- // set up the request
- curl_setopt($ch, CURLOPT_URL, 'http://www.example.com');
- // make sure we submit this as a post
- curl_setopt($ch, CURLOPT_POST, true);
- //$postParams 是 准备post的数据
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
- // make sure problems are caught
- curl_setopt($ch, CURLOPT_FAILONERROR, 1);
- // return the output
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- // set the timeouts
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
- curl_setopt($ch, CURLOPT_TIMEOUT,200);
- // set the PHP script's timeout to be greater than CURL's
- set_time_limit(300);
- $result = curl_exec($ch);
复制代码
我post的数据会丢失.
[ 本帖最后由 yueliangdao0608 于 2006-8-19 16:27 编辑 ] |
|